buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = "https://maven.tterrag.com/" } maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.10.1' classpath group: 'com.wynprice.cursemaven', name: 'CurseMaven', version: '2.1.5' } } plugins { id "com.github.johnrengelman.shadow" version "4.0.4" } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'kotlin' apply plugin: 'org.jetbrains.dokka' version = "1.7.0" group = 'thedarkcolour.kotlinforforge' archivesBaseName = 'kotlinforforge' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' tasks.build.dependsOn kotlinSourcesJar tasks.build.dependsOn shadowJar repositories { mavenCentral() maven { name = 'Yarn Mappings' url = 'https://maven.tterrag.com/' } maven { name = 'Dokka' url = 'https://dl.bintray.com/kotlin/dokka' } maven { name = "CurseForge" url = "https://minecraft.curseforge.com/api/maven/" } } dependencies { minecraft 'net.minecraftforge:forge:1.16.2-33.0.22' compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: kotlin_version compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk7", version: kotlin_version compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: kotlin_version compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: kotlin_version compile group: "org.jetbrains", name: "annotations", version: annotations_version compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: coroutines_version compile group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-jdk8", version: coroutines_version // Tests implementation 'junit:junit:4.11' } minecraft { mappings channel: 'snapshot', version: '20200723-1.16.1' runs { client { workingDirectory project.file('run') property 'forge.logging.console.level', 'debug' } server { workingDirectory project.file('run/server') property 'forge.logging.console.level', 'debug' } } } shadowJar { classifier = "obf" dependencies { include dependency("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}") include dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}") include dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}") include dependency("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}") include dependency("org.jetbrains:annotations:${annotations_version}") include dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutines_version}") include dependency("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${coroutines_version}") } } jar { manifest { attributes(["FMLModType": "LANGPROVIDER"]) attributes([ "Specification-Title": "Mod Language Provider", "Specification-Vendor": "Forge", "Specification-Version": "1", "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"thedarkcolour", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ], "thedarkcolour/kotlinforforge/") } } static def options(kotlinOptions) { kotlinOptions.jvmTarget = '1.8' kotlinOptions.freeCompilerArgs = ["-Xexplicit-api=warning"] } compileKotlin { options(kotlinOptions) } compileTestKotlin { options(kotlinOptions) } kotlinSourcesJar { from(sourceSets.main.kotlin.srcDirs) } dokka { outputFormat = 'html' outputDirectory = "$buildDir/dokka" configuration { reportUndocumented = true } }