diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 83 |
1 files changed, 24 insertions, 59 deletions
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" } } |