Skip to content

Commit 63ab222

Browse files
committed
0.2.0+alpha.1
1 parent 99c4b51 commit 63ab222

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pipeline {
1313
publisherStrategy: 'EXPLICIT'
1414
) {
1515
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
16+
sh 'git fetch --tags'
1617
sh 'chmod +x ./gradlew'
1718
sh './gradlew clean build'
1819
}

build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ sourceCompatibility = JavaVersion.VERSION_16
88
targetCompatibility = JavaVersion.VERSION_16
99

1010
archivesBaseName = "${project.archives_base_name}-mc${project.minecraft_version}"
11-
version = project.mod_version
11+
version = project.mod_version + "." + commitsSinceLastTag()
1212
group = project.maven_group
1313

14+
getLogger().info("Version String: ${version}")
15+
1416
loom {
1517
accessWidener "src/main/resources/c2me.accesswidener"
1618
}
@@ -87,3 +89,17 @@ publishing {
8789
// mavenLocal()
8890
}
8991
}
92+
93+
String commitsSinceLastTag() {
94+
def stdout = new ByteArrayOutputStream()
95+
exec {
96+
commandLine 'git', 'describe', '--tags'
97+
standardOutput = stdout
98+
}
99+
stdout = stdout.toString()
100+
if (stdout.indexOf('-') < 0) {
101+
return 0;
102+
}
103+
def split = stdout.split('-')
104+
return split[split.length - 2]
105+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ minecraft_version=1.17.1-pre1
88
yarn_mappings=1.17.1-pre1+build.1
99
loader_version=0.11.3
1010
# Mod Properties
11-
mod_version=0.1-SNAPSHOT
11+
mod_version=0.2.0+alpha.1
1212
maven_group=com.ishland.c2me
1313
archives_base_name=c2me-fabric
1414
# Java Dependencies

0 commit comments

Comments
 (0)