1- import cam72cam.universalmodcore.Util ;
2-
31buildscript {
42 repositories {
53 maven { url = " https://maven.minecraftforge.net/" }
6- maven { url = " https://teamopenindustry.cc/maven" }
7- jcenter()
4+ maven { url " https://plugins.gradle.org/" }
85 mavenCentral()
96 }
107 dependencies {
11- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
12- classpath ' cam72cam.universalmodcore:UniversalModCoreGradle:0.1.3'
8+ classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.69' , changing : true
139 }
1410}
11+
1512apply plugin : ' net.minecraftforge.gradle'
16- // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1713apply plugin : ' eclipse'
18- // apply plugin: 'maven'
1914apply plugin : ' maven-publish'
2015
21- java. toolchain. languageVersion = JavaLanguageVersion . of(17 ) // Mojang ships Java 8 to end users, so your mod should target Java 8.
16+ java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
2217
23- String baseVersion = " 1.2 "
18+ String baseVersion = " 1.3 "
2419if (! " release" . equalsIgnoreCase(System . getProperty(" target" ))) {
25- baseVersion + = " -" + Util.GitRevision ()
20+ try {
21+ baseVersion + = " -" + ' git rev-parse --verify --short=7 HEAD' . execute(). text. trim()
22+ } catch (Exception ex) {
23+ baseVersion + = " -unknown"
24+ }
2625}
2726version = " 1.18.2-forge-" + baseVersion
2827group = " trackapi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
2928archivesBaseName = " TrackAPI"
3029
30+ java {
31+ withSourcesJar()
32+ }
33+
3134minecraft {
3235 // The mappings can be changed at any time, and must be in the following format.
3336 // snapshot_YYYYMMDD Snapshot are built nightly.
@@ -36,7 +39,7 @@ minecraft {
3639 // Simply re-run your setup task after changing the mappings to update your workspace.
3740 mappings channel : ' official' , version : ' 1.18.2'
3841 // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
39-
42+
4043 // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
4144
4245 // Default run configurations.
@@ -52,7 +55,7 @@ minecraft {
5255 property ' forge.logging.console.level' , ' debug'
5356
5457 mods {
55- examplemod {
58+ trackapi {
5659 source sourceSets. main
5760 }
5861 }
@@ -68,7 +71,7 @@ minecraft {
6871 property ' forge.logging.console.level' , ' debug'
6972
7073 mods {
71- examplemod {
74+ trackapi {
7275 source sourceSets. main
7376 }
7477 }
@@ -77,16 +80,13 @@ minecraft {
7780 data {
7881 workingDirectory project. file(' run' )
7982
80- // Recommended logging data for a userdev environment
8183 property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
82-
83- // Recommended logging level for the console
8484 property ' forge.logging.console.level' , ' debug'
8585
86- args ' --mod' , ' examplemod ' , ' --all' , ' --output' , file(' src/generated/resources/' )
86+ args ' --mod' , ' trackapi ' , ' --all' , ' --output' , file(' src/generated/resources/' )
8787
8888 mods {
89- examplemod {
89+ trackapi {
9090 source sourceSets. main
9191 }
9292 }
@@ -97,44 +97,8 @@ minecraft {
9797sourceSets. main. resources { srcDir ' src/generated/resources' }
9898
9999dependencies {
100- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
101- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
102- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
103100 minecraft ' net.minecraftforge:forge:1.18.2-40.0.22'
104-
105- // You may put jars on which you depend on in ./libs or you may define them like so..
106- // compile "some.group:artifact:version:classifier"
107- // compile "some.group:artifact:version"
108-
109- // Real examples
110- // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
111- // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
112-
113- // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
114- // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
115-
116- // These dependencies get remapped to your current MCP mappings
117- // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
118-
119- // For more info...
120- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
121- // http://www.gradle.org/docs/current/userguide/dependency_management.html
122-
123- }
124-
125- // Example for how to get properties into the manifest for reading by the runtime..
126- jar {
127- manifest {
128- attributes([
129- " Specification-Title" : " trackapi" ,
130- " Specification-Vendor" : " trackapi" ,
131- " Specification-Version" : " 1" , // We are version 1 of ourselves
132- " Implementation-Title" : project. name,
133- " Implementation-Version" : " ${ version} " ,
134- " Implementation-Vendor" :" trackapi" ,
135- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
136- ])
137- }
101+ minecraftLibrary " org.apache.maven.wagon:wagon-ssh:3.5.3"
138102}
139103
140104jar. finalizedBy(' reobfJar' )
@@ -143,6 +107,8 @@ publishing {
143107 publications {
144108 mavenJava(MavenPublication ) {
145109 artifact jar
110+ artifact sourcesJar
111+ artifactId archivesBaseName
146112 }
147113 }
148114 repositories {
@@ -156,49 +122,12 @@ publishing {
156122 }
157123}
158124
159-
160-
161-
162- /*
163- // Example configuration to allow publishing using the maven-publish task
164- // we define a custom artifact that is sourced from the reobfJar output task
165- // and then declare that to be published
166- // Note you'll need to add a repository here
167- def reobfFile = file("$buildDir/reobfJar/output.jar")
168- def reobfArtifact = artifacts.add('default', reobfFile) {
169- type 'jar'
170- builtBy 'reobfJar'
171- }
172- publishing {
173- publications {
174- mavenJava(MavenPublication) {
175- artifact reobfArtifact
176- }
177- }
178- repositories {
179- maven {
180- url "file:///${project.projectDir}/mcmodsrepo"
181- }
125+ task (' showBuildInfo' ) {
126+ doLast {
127+ System . out. println (" Build Uploaded to Maven at: " )
128+ System . out. println (" https://teamopenindustry.cc/maven/trackapi/TrackAPI/${ version} /TrackAPI-${ version} .jar" )
182129 }
183130}
184131
185- task deployJar(type: Jar)
186-
187- configurations {
188- deployerJars
189- }
132+ publish. finalizedBy showBuildInfo
190133
191- dependencies {
192- deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
193- }
194-
195- uploadArchives {
196- tasks.uploadArchives.dependsOn build
197- repositories.mavenDeployer {
198- configuration = configurations.deployerJars
199- repository(url: "scp://teamopenindustry.cc/var/www/html/maven/") {
200- authentication(userName: "mavenci", privateKey: "publish_key")
201- }
202- }
203- }
204- */
0 commit comments