File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import org.ajoberstar.grgit.Grgit
2+ import java.util.*
3+
14plugins {
25 kotlin(" jvm" ) version " 1.8.20"
6+ id(" org.ajoberstar.grgit" ) version " 5.2.0"
37 `java- library`
48}
59
10+ if (! File (" $rootDir /.git" ).exists()) {
11+ logger.lifecycle(
12+ """
13+ **************************************************************************************
14+ You need to fork and clone this repository! Don't download a .zip file.
15+ If you need assistance, consult the GitHub docs: https://docs.github.com/get-started/quickstart/fork-a-repo
16+ **************************************************************************************
17+ """ .trimIndent()
18+ ).also { System .exit(1 ) }
19+ }
20+
621group = " net.onelitefeather"
7- version = " 1.0.0-SNAPSHOT"
22+ var baseVersion by extra(" 1.0.0" )
23+ var extension by extra(" " )
24+ var snapshot by extra(" -SNAPSHOT" )
25+
26+ ext {
27+ val git: Grgit = Grgit .open {
28+ dir = File (" $rootDir /.git" )
29+ }
30+ val revision = git.head().abbreviatedId
31+ extension = " %s+%s" .format(Locale .ROOT , snapshot, revision)
32+ }
33+
34+
35+ version = " %s%s" .format(Locale .ROOT , baseVersion, extension)
836
937repositories {
1038 mavenCentral()
@@ -14,10 +42,17 @@ dependencies {
1442 testImplementation(kotlin(" test" ))
1543}
1644
17- tasks.test {
18- useJUnitPlatform()
45+ tasks {
46+ test {
47+ useJUnitPlatform()
48+ }
1949}
2050
2151kotlin {
22- jvmToolchain(11 )
52+ jvmToolchain(17 )
53+ sourceSets.all {
54+ languageSettings {
55+ languageVersion = " 2.0"
56+ }
57+ }
2358}
You can’t perform that action at this time.
0 commit comments