1- import cam72cam.universalmodcore.Util ;
2-
31buildscript {
42 repositories {
5- mavenCentral()
63 maven { url = " https://maven.minecraftforge.net/" }
7- maven { url = " https://teamopenindustry.cc/maven" }
4+ maven { url " https://plugins.gradle.org/" }
5+ mavenCentral()
86 }
97 dependencies {
10- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
11- classpath ' cam72cam.universalmodcore:UniversalModCoreGradle:0.1.3'
8+ classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.69' , changing : true
129 }
1310}
11+
1412apply plugin : ' net.minecraftforge.gradle'
15- // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1613apply plugin : ' eclipse'
1714apply plugin : ' maven-publish'
1815
19- java. toolchain. languageVersion = JavaLanguageVersion . of(16 ) // Mojang ships Java 8 to end users, so your mod should target Java 8.
16+ java. toolchain. languageVersion = JavaLanguageVersion . of(16 )
2017
2118String baseVersion = " 1.3"
2219if (! " release" . equalsIgnoreCase(System . getProperty(" target" ))) {
23- 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+ }
2425}
2526version = " 1.17.1-forge-" + baseVersion
2627group = " trackapi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
2728archivesBaseName = " TrackAPI"
2829
30+ java {
31+ withSourcesJar()
32+ }
33+
2934minecraft {
3035 // The mappings can be changed at any time, and must be in the following format.
3136 // snapshot_YYYYMMDD Snapshot are built nightly.
@@ -50,7 +55,7 @@ minecraft {
5055 property ' forge.logging.console.level' , ' debug'
5156
5257 mods {
53- examplemod {
58+ trackapi {
5459 source sourceSets. main
5560 }
5661 }
@@ -66,7 +71,7 @@ minecraft {
6671 property ' forge.logging.console.level' , ' debug'
6772
6873 mods {
69- examplemod {
74+ trackapi {
7075 source sourceSets. main
7176 }
7277 }
@@ -75,16 +80,13 @@ minecraft {
7580 data {
7681 workingDirectory project. file(' run' )
7782
78- // Recommended logging data for a userdev environment
7983 property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
80-
81- // Recommended logging level for the console
8284 property ' forge.logging.console.level' , ' debug'
8385
84- args ' --mod' , ' examplemod ' , ' --all' , ' --output' , file(' src/generated/resources/' )
86+ args ' --mod' , ' trackapi ' , ' --all' , ' --output' , file(' src/generated/resources/' )
8587
8688 mods {
87- examplemod {
89+ trackapi {
8890 source sourceSets. main
8991 }
9092 }
@@ -95,42 +97,8 @@ minecraft {
9597sourceSets. main. resources { srcDir ' src/generated/resources' }
9698
9799dependencies {
98- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
99- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
100- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
101100 minecraft ' net.minecraftforge:forge:1.17.1-37.1.1'
102-
103- // You may put jars on which you depend on in ./libs or you may define them like so..
104- // compile "some.group:artifact:version:classifier"
105- // compile "some.group:artifact:version"
106-
107- // Real examples
108- // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
109- // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
110-
111- // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
112- // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
113-
114- // These dependencies get remapped to your current MCP mappings
115- // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
116-
117- // For more info...
118- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
119- // http://www.gradle.org/docs/current/userguide/dependency_management.html
120-
121- }
122-
123- // Example for how to get properties into the manifest for reading by the runtime..
124- jar {
125- manifest {
126- attributes([
127- " Specification-Title" : " TrackAPI" ,
128- " Specification-Version" : " 1" , // We are version 1 of ourselves
129- " Implementation-Title" : project. name,
130- " Implementation-Version" : " ${ version} " ,
131- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
132- ])
133- }
101+ minecraftLibrary " org.apache.maven.wagon:wagon-ssh:3.5.3"
134102}
135103
136104jar. finalizedBy(' reobfJar' )
@@ -139,6 +107,8 @@ publishing {
139107 publications {
140108 mavenJava(MavenPublication ) {
141109 artifact jar
110+ artifact sourcesJar
111+ artifactId archivesBaseName
142112 }
143113 }
144114 repositories {
@@ -150,4 +120,14 @@ publishing {
150120 }
151121 }
152122 }
153- }
123+ }
124+
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" )
129+ }
130+ }
131+
132+ publish. finalizedBy showBuildInfo
133+
0 commit comments