diff options
author | modmuss50 <modmuss50@gmail.com> | 2021-05-20 23:47:48 +0100 |
---|---|---|
committer | modmuss50 <modmuss50@gmail.com> | 2021-05-20 23:47:48 +0100 |
commit | de665ab4989bceb4ff323ebc0851ef781a0ef5de (patch) | |
tree | 6d3a5f08e42662073fb9336c0fede01562fbd4bc /src/test/resources/projects/signed | |
parent | 93b2aebaf8e2926bfd4bc44cb50aa2e4251e24fe (diff) | |
download | architectury-loom-de665ab4989bceb4ff323ebc0851ef781a0ef5de.tar.gz architectury-loom-de665ab4989bceb4ff323ebc0851ef781a0ef5de.tar.bz2 architectury-loom-de665ab4989bceb4ff323ebc0851ef781a0ef5de.zip |
Add SignedProjectTest #404
Diffstat (limited to 'src/test/resources/projects/signed')
4 files changed, 76 insertions, 0 deletions
diff --git a/src/test/resources/projects/signed/build.gradle b/src/test/resources/projects/signed/build.gradle new file mode 100644 index 00000000..5da48236 --- /dev/null +++ b/src/test/resources/projects/signed/build.gradle @@ -0,0 +1,57 @@ +plugins { + id 'fabric-loom' + id 'maven-publish' + id 'signing' +} + +archivesBaseName = "fabric-example-lib" +version = "1.0.0" +group = "com.example" + +dependencies { + minecraft "com.mojang:minecraft:1.16.5" + mappings "net.fabricmc:yarn:1.16.5+build.5:v2" + modImplementation "net.fabricmc:fabric-loader:0.11.2" +} + +processResources { + inputs.property "version", project.version + + filesMatching("fabric.mod.json") { + expand "version": project.version + } +} + +java { + withSourcesJar() +} + +publishing { + publications { + mavenJava(MavenPublication) { + artifact(remapJar) { + builtBy remapJar + } + artifact(remapJar) { + builtBy remapJar + classifier "classifier" + } + artifact(sourcesJar) { + builtBy remapSourcesJar + } + } + } + + repositories { + maven { + url "http://localhost:${System.getProperty("loom.test.mavenPort")}/" + allowInsecureProtocol = true + } + } +} + +signing { + def privateKey = System.getProperty("loom.test.secretKey") ?: "no key!" + useInMemoryPgpKeys(privateKey, 'password') + sign publishing.publications.mavenJava +} diff --git a/src/test/resources/projects/signed/main/java/net/fabricmc/example/ExampleLib.java b/src/test/resources/projects/signed/main/java/net/fabricmc/example/ExampleLib.java new file mode 100644 index 00000000..e6ec1e65 --- /dev/null +++ b/src/test/resources/projects/signed/main/java/net/fabricmc/example/ExampleLib.java @@ -0,0 +1,13 @@ +package net.fabricmc.example; + +import net.fabricmc.api.ModInitializer; + +public class ExampleLib implements ModInitializer { + @Override + public void onInitialize() { + } + + public static void hello() { + System.out.println("Hello Fabric world!"); + } +} diff --git a/src/test/resources/projects/signed/main/resources/fabric.mod.json b/src/test/resources/projects/signed/main/resources/fabric.mod.json new file mode 100644 index 00000000..f527100e --- /dev/null +++ b/src/test/resources/projects/signed/main/resources/fabric.mod.json @@ -0,0 +1,4 @@ +{ + "schemaVersion": 1, + "id": "modid" +} diff --git a/src/test/resources/projects/signed/settings.gradle b/src/test/resources/projects/signed/settings.gradle new file mode 100644 index 00000000..fc4c0f72 --- /dev/null +++ b/src/test/resources/projects/signed/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = "fabric-example-lib" + |