Switch to Gradle Kotlin DSL #103
92
build.gradle
@ -1,92 +0,0 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.7-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
|
||||
repositories {
|
||||
// Add repositories to retrieve artifacts from in here.
|
||||
// You should only use this when depending on other mods because
|
||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
// for more information about repositories.
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
// You may need to force-disable transitiveness on them.
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
it.options.encoding = "UTF-8"
|
||||
|
||||
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
|
||||
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
|
||||
// We'll use that if it's available, but otherwise we'll use the older option.
|
||||
def targetVersion = 8
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
it.options.release = targetVersion
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this line, sources will not be generated.
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${project.archivesBaseName}"}
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
// add all the jars that should be included when publishing to maven
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
95
build.gradle.kts
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
plugins {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
id("fabric-loom") version "0.7-SNAPSHOT"
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
`maven-publish`
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val targetCompatibility = JavaVersion.VERSION_1_8
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val archives_base_name: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val mod_version: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val maven_group: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
![]() Why these? Are they no longer automatically polled from Why these? Are they no longer automatically polled from `gradle.properties`? Preferable if you poll from the properties in the `{$}` evaluation block.
![]() Because that's not really possible in Kotlin hence the type safe part you need to explicitly declare your gradle.properties variables Because that's not really possible in Kotlin hence the type safe part you need to explicitly declare your gradle.properties variables
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
repositories {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// Add repositories to retrieve artifacts from in here.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// You should only use this when depending on other mods because
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// for more information about repositories.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val minecraft_version: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val yarn_mappings: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val loader_version: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val fabric_version: String by project
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
dependencies {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// To change the versions see the gradle.properties file
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
minecraft("com.mojang:minecraft:${minecraft_version}")
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
mappings("net.fabricmc:yarn:${yarn_mappings}:v2")
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
modImplementation("net.fabricmc:fabric-loader:${loader_version}")
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_version}")
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// You may need to force-disable transitiveness on them.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
tasks {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
withType<JavaCompile> {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// If Javadoc is generated, this must be specified in that task too.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
![]() Should just link to https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.CompileOptions.html than some random blog Should just link to https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.CompileOptions.html than some random blog
![]() this is same for the original this is same for the original
![]() I guess he just copied the original but I agree the wall of text could be shortened down I guess he just copied the original but I agree the wall of text could be shortened down
![]() But if you do carry out a big change like switching to kotlin, it's better to fix the overdue technical debt at the same time. But if you do carry out a big change like switching to kotlin, it's better to fix the overdue technical debt at the same time.
|
||||
options.encoding = "UTF-8"
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// We'll use that if it's available, but otherwise we'll use the older option.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val targetVersion = 8
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
if (JavaVersion.current().isJava9Compatible) {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
options.release.convention(targetVersion)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
processResources {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
inputs.property("version", project.version)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
filesMatching("fabric.mod.json") {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
this.expand("version" to project.version)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
jar {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
from("LICENSE") {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
rename { "${it}_${archives_base_name}" }
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
val sourcesJar by creating(Jar::class) {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
dependsOn(classes)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
archiveClassifier.convention("sources")
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
from(sourceSets["main"].allSource)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
publishing {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
publications {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
create<MavenPublication>("maven") {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// add all the jars that should be included when publishing to maven
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
artifact(remapJar.get())
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
artifact(sourcesJar)
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
repositories {
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// Add repositories to publish to here.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
// retrieving dependencies.
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
||||
}
|
||||
![]() use the built-in literal
use the built-in literal `\`maven-publish\``
```suggestion
`maven-publish`
```
![]()
```suggestion
this.expand("version" to project.version)
```
![]()
```suggestion
dependsOn(classes)
```
|
@ -1,8 +1,8 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
name = "Fabric"
|
||||
url = uri("https://maven.fabricmc.net/")
|
||||
}
|
||||
gradlePluginPortal()
|
||||
}
|
||||
![]()
```suggestion
maven("https://maven.fabricmc.net/")
```
![]() Still preferable to explicitly name this maven as Still preferable to explicitly name this maven as `"fabric"`
|
use the built-in literal
\
maven-publish``use the built-in literal
\
maven-publish``