Skip to content

Commit cb0d2b7

Browse files
committed
revert - build.gradle
1 parent 557d04b commit cb0d2b7

2 files changed

Lines changed: 14 additions & 27 deletions

File tree

build.gradle

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ plugins {
55
id 'maven-publish' // for jitpack.io
66
}
77

8-
String group = System.getenv("GROUP") ?: properties["group"] ?: "com.github.server-utilities"
9-
String commitHash = "";
10-
11-
if (System.getenv("JITPACK") != "true") {
12-
rootProject.group = group
13-
rootProject.version = properties["version"] + "." + commitHash
14-
}
8+
group = 'com.github.server-utilities'
9+
version = '1.0.0'
1510

1611
repositories {
1712
mavenCentral()
@@ -74,10 +69,6 @@ shadowJar {
7469
archiveFileName = project.name + '-' + project.version + '.jar'
7570
}
7671

77-
artifacts {
78-
archives shadowJar
79-
}
80-
8172
tasks.register('deploy', Copy) {
8273
// Define the deployment directory
8374
def deployDir = file(System.getenv("DEPLOY_DIR") ?: "$rootDir/deploy")
@@ -89,31 +80,32 @@ tasks.register('deploy', Copy) {
8980
println "Generated JAR file: ${shadowJar.archiveFile}"
9081
}
9182

92-
// Copy the generated jar(s) to the deploy directory
83+
// Copy the shadowJar output
9384
from shadowJar.archiveFile
9485
into deployDir
9586
}
9687

97-
// Ensure that the copyToDeployDir task runs after the shadowJar task
88+
// Ensure that the deploy task runs after the shadowJar task
9889
shadowJar.finalizedBy(deploy)
9990

10091
tasks.named('deploy').configure {
101-
dependsOn shadowJar
102-
dependsOn jar
92+
dependsOn 'shadowJar', 'sourcesJar', 'javadocJar', 'jar'
10393
}
10494

105-
tasks.register('getGitCommitHash') {
106-
doLast {
107-
def ch = 'git rev-parse --short HEAD'.execute().text.trim()
108-
commitHash = ch
95+
publishing {
96+
publications {
97+
maven(MavenPublication) {
98+
from components.java
99+
}
109100
}
110101
}
111102

112-
tasks.named("build").configure {
113-
dependsOn getGitCommitHash
103+
java {
104+
withSourcesJar()
105+
withJavadocJar()
114106
}
115107

116108
wrapper {
117109
gradleVersion = '8.9'
118110
distributionType = Wrapper.DistributionType.BIN
119-
}
111+
}

settings.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
String artifact = System.getenv('ARTIFACT') ?: properties['name'] ?: rootProject.name
2-
3-
if (System.getenv("JITPACK") != "true") {
4-
rootProject.name = artifact
5-
}

0 commit comments

Comments
 (0)