summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorcpw <cpw+github@weeksfamily.ca>2019-03-09 18:43:20 -0500
committercpw <cpw+github@weeksfamily.ca>2019-03-09 18:43:20 -0500
commit52909292acc7bdb4e2b344a2b4aaf2a48d87bfc5 (patch)
tree82d7a3729c40d0abaf15082958d00a2cfa932613 /build.gradle
parentb1cd9faf724a645b84250791a6788044c8dc8fe6 (diff)
Add way to publish the reobf Jar with the maven-publish
task. The standard way does not publish reobfuscated artifacts. Signed-off-by: cpw <cpw+github@weeksfamily.ca>
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle23
1 files changed, 23 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 2b334b1..f693e19 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,6 +11,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
+apply plugin: 'maven-publish'
version = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -105,4 +106,26 @@ jar {
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
+}
+
+// Example configuration to allow publishing using the maven-publish task
+// we define a custom artifact that is sourced from the reobfJar output task
+// and then declare that to be published
+// Note you'll need to add a repository here
+def reobfFile = file("$buildDir/reobfJar/output.jar")
+def reobfArtifact = artifacts.add('default', reobfFile) {
+ type 'jar'
+ builtBy 'reobfJar'
+}
+publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ artifact reobfArtifact
+ }
+ }
+ repositories {
+ maven {
+ url "file:///${project.projectDir}/mcmodsrepo"
+ }
+ }
} \ No newline at end of file