diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-27 15:42:55 +0200 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2021-02-27 15:42:55 +0200 |
commit | 7e1b68e49bcbeb151fd77e9193377e9a360bb7f0 (patch) | |
tree | f05619b4fb7f16145fd8e9d5ce7090fecc63c2d0 | |
parent | 052c253ba44f2e9083ab4c3149d076ce988691a6 (diff) | |
download | LibGui-7e1b68e49bcbeb151fd77e9193377e9a360bb7f0.tar.gz LibGui-7e1b68e49bcbeb151fd77e9193377e9a360bb7f0.tar.bz2 LibGui-7e1b68e49bcbeb151fd77e9193377e9a360bb7f0.zip |
Update Loom and use Maven Publish instead of the Artifactory plugin
-rw-r--r-- | GuiTest/build.gradle | 29 | ||||
-rw-r--r-- | build.gradle | 83 |
2 files changed, 37 insertions, 75 deletions
diff --git a/GuiTest/build.gradle b/GuiTest/build.gradle index c1423b2..bbb0f0f 100644 --- a/GuiTest/build.gradle +++ b/GuiTest/build.gradle @@ -14,7 +14,9 @@ version = rootProject.version group = rootProject.group loom { - autoGenIDERuns = true + runConfigs.configureEach { + ideConfigGenerated = true + } } //configurations.modApi { @@ -40,29 +42,24 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } -// 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 tasks.withType(JavaCompile) { + // 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 options.encoding = "UTF-8" + + if (JavaVersion.current().isJava9Compatible()) { + options.release.set 8 + } } -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + withSourcesJar() } jar { diff --git a/build.gradle b/build.gradle index d7c3955..94e6f0a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,12 @@ plugins { - id 'fabric-loom' version '0.5-SNAPSHOT' + id 'fabric-loom' version '0.6-SNAPSHOT' id 'maven-publish' - id "com.jfrog.artifactory" version "4.20.0" id 'checkstyle' } sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - - if(rootProject.file('private.gradle').exists()) { //Publishing details apply from: 'private.gradle' } @@ -19,7 +16,7 @@ version = "$project.mod_version+$project.minecraft_version" group = project.maven_group repositories { - maven { url "http://server.bbkr.space:8081/artifactory/libs-release" } + maven { url "https://server.bbkr.space/artifactory/libs-release" } maven { url = "http://maven.terraformersmc.com/releases" content { @@ -44,29 +41,25 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } +} - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } +java { + withSourcesJar() + withJavadocJar() } -// 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 tasks.withType(JavaCompile) { + // 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 options.encoding = "UTF-8" -} -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource + if (JavaVersion.current().isJava9Compatible()) { + options.release.set 8 + } } jar { @@ -82,58 +75,30 @@ checkstyle { publishing { publications { maven(MavenPublication) { - // add all the jars that should be included when publishing to maven - //artifact(jar) { - // builtBy remapJar - //} - artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") { //release jar - file location not provided anywhere in loom - artifactId = "LibGui" - classifier null - builtBy remapJar - } - - artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") { //release jar - file location not provided anywhere in loom - artifactId = "LibGui" - classifier "dev" + artifact(remapJar) { builtBy remapJar } artifact(sourcesJar) { - artifactId = "LibGui" builtBy remapSourcesJar } + + artifact(javadocJar) } } // select the repositories you want to publish to repositories { - // uncomment to publish to the local maven - // mavenLocal() - } -} - -artifactory { - if (project.hasProperty("artifactoryUsername")) { - contextUrl = "http://server.bbkr.space:8081/artifactory/" - publish { - repository { - if (version.contains("SNAPSHOT")) { - repoKey = "libs-snapshot" - } else { - repoKey = "libs-release" + if (project.hasProperty("artifactoryUsername")) { + maven { + url = "https://server.bbkr.space/artifactory/libs-release/" + credentials { + username = artifactoryUsername + password = artifactoryPassword } - - username = artifactoryUsername - password = artifactoryPassword - } - defaults { - publications("maven") - - publishArtifacts = true - publishPom = true } + } else { + println "Cannot configure artifactory; please define ext.artifactoryUsername and ext.artifactoryPassword before running publish" } - } else { - println "Cannot configure artifactory; please define ext.artifactoryUsername and ext.artifactoryPassword before running artifactoryPublish" } } |