1- import Properties.group
2-
31buildscript {
42 repositories {
53 gradlePluginPortal()
@@ -10,109 +8,66 @@ buildscript {
108 }
119}
1210
11+ fun getCommitHash (): String = try {
12+ val runtime = Runtime .getRuntime()
13+ val process = runtime.exec(" git rev-parse --short HEAD" )
14+ val out = process.inputStream
15+ out .bufferedReader().readText().trim()
16+ } catch (ignored: Exception ) {
17+ " unknown"
18+ }
19+
1320// Define Plugins
1421plugins {
1522 id(" java" )
1623 id(" maven-publish" )
1724 id(" com.github.johnrengelman.shadow" ) version " 6.1.0"
18- kotlin(" jvm" ) version " 1.5 .10"
25+ kotlin(" jvm" ) version " 1.6 .10"
1926}
2027
2128
2229// Define Repositorys
2330repositories {
24- for (field in Repositories ::class .java.declaredFields) {
25- if (field.name != " INSTANCE" ) {
26- println (" Added Repository: " + field.get(null ))
27- maven(field.get(null ))
28- }
29- }
31+ mavenCentral()
32+ maven(" https://repo.cloudnetservice.eu/repository/releases/" )
3033}
3134
3235// Define Version and Group
33- group = Properties .group
34- version = Properties .version
36+ group = " me.infinity.cloudnetmongodb "
37+ version = " 2.1.0 "
3538
3639
3740// Define Dependencies for all Modules
3841dependencies {
39- implementation(getDependency( " kotlin" , " stdlib" ) )
40- implementation(getDependency( " kotlinx" , " coroutines-core" ) )
41- compileOnly(getDependency( " cloudnet " , " cloudnet " ) )
42- implementation(getDependency( " database " , " mongo " ) )
42+ implementation(" org.jetbrains. kotlin:kotlin- stdlib:1.6.10 " )
43+ implementation(" org.jetbrains. kotlinx:kotlinx- coroutines-core:1.6.0 " )
44+ compileOnly(" org.mongodb:mongodb-driver-sync:4.4.1 " )
45+ implementation(" de.dytanic.cloudnet:cloudnet:3.4.2-RELEASE " )
4346}
4447
45- if (System .getProperty(" publishName" ) != null && System .getProperty(" publishPassword" ) != null ) {
46- publishing {
47- (components[" java" ] as AdhocComponentWithVariants ).withVariantsFromConfiguration(configurations[" shadowRuntimeElements" ]) {
48- skip()
49- }
50- publications {
51- create<MavenPublication >(project.name) {
52- groupId = Properties .group
53- artifactId = project.name
54- version = Properties .version
55- from(components.findByName(" java" ))
56- pom {
57- name.set(project.name)
58- url.set(" https://github.com/VironLab/Vextension" )
59- properties.put(" inceptionYear" , " 2021" )
60- licenses {
61- license {
62- name.set(" General Public License (GPL v3.0)" )
63- url.set(" https://www.gnu.org/licenses/gpl-3.0.txt" )
64- distribution.set(" repo" )
65- }
66- }
67- developers {
68- developer {
69- id.set(" Infinity_dev" )
70- name.set(" Florin Dornig" )
71- email.set(" infinitydev@vironlab.eu" )
72- }
73- }
74- }
75- }
76- repositories {
77- maven(" https://repo.vironlab.eu/repository/maven-snapshot/" ) {
78- this .name = " vironlab-snapshot"
79- credentials {
80- this .password = System .getProperty(" publishPassword" )
81- this .username = System .getProperty(" publishName" )
82- }
83- }
84- }
85- }
86- }
87- }
8848tasks {
8949
90- test {
91- useJUnitPlatform()
92- }
93-
9450 // Set the Name of the Sources Jar
9551 kotlinSourcesJar {
96- archiveFileName.set(" ${project.name} -${Properties .version} -${getCommitHash()} -sources.jar" )
52+ archiveFileName.set(" ${project.name} -${project .version} -${getCommitHash()} -sources.jar" )
9753 doFirst {
9854 // Set Manifest
9955 manifest {
10056 attributes[" Implementation-Title" ] = project.name
10157 attributes[" Implementation-Version" ] = findProperty(" version" ).toString()
10258 attributes[" Specification-Version" ] = findProperty(" version" ).toString()
103- attributes[" Implementation-Vendor" ] = " VironLab.eu "
59+ attributes[" Implementation-Vendor" ] = " Florin Dornig "
10460 attributes[" Built-By" ] = System .getProperty(" user.name" )
10561 attributes[" Build-Jdk" ] = System .getProperty(" java.version" )
10662 attributes[" Created-By" ] = " Gradle ${gradle.gradleVersion} "
107- attributes[" VironLab-AppId" ] = " cloudnet_mongodb"
10863 attributes[" Commit-Hash" ] = getCommitHash()
10964 }
11065 }
11166 }
11267
11368 shadowJar {
11469 // Set the Name of the Output File
115- archiveFileName.set(" ${project.name} -${Properties .version} -${getCommitHash()} -full.jar" )
70+ archiveFileName.set(" ${project.name} -${project .version} -${getCommitHash()} -full.jar" )
11671
11772 exclude(" META-INF/**" )
11873
@@ -122,29 +77,27 @@ tasks {
12277 attributes[" Implementation-Title" ] = project.name
12378 attributes[" Implementation-Version" ] = findProperty(" version" ).toString()
12479 attributes[" Specification-Version" ] = findProperty(" version" ).toString()
125- attributes[" Implementation-Vendor" ] = " VironLab.eu "
80+ attributes[" Implementation-Vendor" ] = " Florin Dornig "
12681 attributes[" Built-By" ] = System .getProperty(" user.name" )
12782 attributes[" Build-Jdk" ] = System .getProperty(" java.version" )
12883 attributes[" Created-By" ] = " Gradle ${gradle.gradleVersion} "
129- attributes[" VironLab-AppId" ] = " cloudnet_mongodb"
13084 attributes[" Commit-Hash" ] = getCommitHash()
13185 }
13286 }
13387 }
13488
13589 jar {
136- archiveFileName.set(" ${project.name} -${Properties .version} -${getCommitHash()} .jar" )
90+ archiveFileName.set(" ${project.name} -${project .version} -${getCommitHash()} .jar" )
13791 doFirst {
13892 // Set Manifest
13993 manifest {
14094 attributes[" Implementation-Title" ] = project.name
14195 attributes[" Implementation-Version" ] = findProperty(" version" ).toString()
14296 attributes[" Specification-Version" ] = findProperty(" version" ).toString()
143- attributes[" Implementation-Vendor" ] = " VironLab.eu "
97+ attributes[" Implementation-Vendor" ] = " Florin Dornig "
14498 attributes[" Built-By" ] = System .getProperty(" user.name" )
14599 attributes[" Build-Jdk" ] = System .getProperty(" java.version" )
146100 attributes[" Created-By" ] = " Gradle ${gradle.gradleVersion} "
147- attributes[" VironLab-AppId" ] = " cloudnet_mongodb"
148101 attributes[" Commit-Hash" ] = getCommitHash()
149102 }
150103 }
0 commit comments