diff --git a/build.gradle b/build.gradle index 9ece513..cae8bb5 100644 --- a/build.gradle +++ b/build.gradle @@ -19,62 +19,48 @@ if (ENV.BUILD_NUMBER) { build = "jenkins #${ENV.BUILD_NUMBER}" } - - -// Remove the gradleApi so it isn't merged into the jar file. -configurations.compile.dependencies.remove dependencies.gradleApi() - repositories { mavenCentral() maven { name = "Modmuss" url = 'http://maven.modmuss50.me/' } - maven { - name = 'Mojang' - url = 'https://libraries.minecraft.net/' - } - maven { - name = 'SpongePowered' - url = 'http://repo.spongepowered.org/maven' - } -} - -configurations { - deployerJars - shade - compile.extendsFrom shade } dependencies { implementation gradleApi() - shade('commons-io:commons-io:2.6') - shade('org.zeroturnaround:zt-zip:1.13') - shade('com.google.code.gson:gson:2.8.5') - shade('com.google.guava:guava:27.0-jre') - shade('net.fabricmc:stitch:0.1.0.+') { + implementation ('commons-io:commons-io:2.6') + implementation ('org.zeroturnaround:zt-zip:1.13') + implementation ('com.google.code.gson:gson:2.8.5') + implementation ('com.google.guava:guava:27.0-jre') + implementation ('net.fabricmc:stitch:0.1.0.+') + implementation ('net.fabricmc:tiny-remapper:0.1.0.16') { transitive = false } - shade('net.fabricmc:tiny-remapper:0.1.0.16') - shade('org.spongepowered:mixin:0.7.11-SNAPSHOT') { + implementation ('net.fabricmc:sponge-mixin:0.7.11.3') { exclude module: 'launchwrapper' exclude module: 'guava' } } jar { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - from(configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }) { - exclude 'META-INF/*' - exclude 'META-INF' - } manifest { attributes 'Implementation-Version': version + " Build(" + build + ")" } } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle' task wrapper(type: Wrapper) { @@ -92,15 +78,15 @@ gradlePlugin { publishing { publications { - pluginMaven(MavenPublication) { publication -> + plugin(MavenPublication) { publication -> groupId project.group artifactId project.archivesBaseName version project.version - //Removes all of the dependencies from the maven pom, prevents sub projects downloading all the libs, as we use a fat jar - pom.withXml { - asNode().remove(asNode().get('dependencies')) - } + from components["java"] + + artifact sourcesJar + artifact javadocJar } } repositories { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0b3fb8..e2ffac9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Sat Nov 03 23:12:45 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/src/main/java/net/fabricmc/loom/AbstractPlugin.java b/src/main/java/net/fabricmc/loom/AbstractPlugin.java index 0dc3c55..848e420 100644 --- a/src/main/java/net/fabricmc/loom/AbstractPlugin.java +++ b/src/main/java/net/fabricmc/loom/AbstractPlugin.java @@ -67,8 +67,7 @@ public class AbstractPlugin implements Plugin { project.apply(ImmutableMap.of("plugin", "eclipse")); project.apply(ImmutableMap.of("plugin", "idea")); - project.getExtensions().create("minecraft", LoomGradleExtension.class); - project.getExtensions().getByType(LoomGradleExtension.class).project = project; + project.getExtensions().create("minecraft", LoomGradleExtension.class, project); LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class); readModJson(extension); diff --git a/src/main/java/net/fabricmc/loom/LoomGradleExtension.java b/src/main/java/net/fabricmc/loom/LoomGradleExtension.java index e16fb5c..a3a9eb9 100644 --- a/src/main/java/net/fabricmc/loom/LoomGradleExtension.java +++ b/src/main/java/net/fabricmc/loom/LoomGradleExtension.java @@ -39,7 +39,11 @@ public class LoomGradleExtension { public boolean localMappings = false; //Not to be set in the build.gradle - public Project project; + private Project project; + + public LoomGradleExtension(Project project) { + this.project = project; + } public String getVersionString() { if (isModWorkspace()) {