Skip to content

Commit 5e31565

Browse files
author
Zihlu Wang
committed
build: Changed toolchain to gradle.
1 parent 367a96b commit 5e31565

File tree

25 files changed

+1111
-1001
lines changed

25 files changed

+1111
-1001
lines changed

build.gradle.kts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (C) 2023 CodeCraftersCN.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
*
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
val projectUrl by extra("https://codecrafters.org.cn/JDevKit")
19+
val projectGithubUrl by extra("https://github.com/CodeCraftersCN/JDevKit")
20+
val globalGroupId by extra("cn.org.codecrafters")
21+
val globalVersion by extra("1.2.3")
22+
val licenseName by extra("The Apache License, Version 2.0")
23+
val licenseUrl by extra("https://www.apache.org/licenses/LICENSE-2.0.txt")
24+
25+
val logbackVersion: String by project
26+
val junitVersion: String by project
27+
val slf4jVersion: String by project
28+
val lombokVersion: String by project
29+
val jacksonVersion: String by project
30+
val javaJwtVersion: String by project
31+
val jjwtVersion: String by project
32+
val okhttpVersion: String by project
33+
val springVersion: String by project
34+
val springBootVersion: String by project
35+
36+
subprojects {
37+
apply(plugin = "java")
38+
apply(plugin = "java-library")
39+
apply(plugin = "maven-publish")
40+
apply(plugin = "signing")
41+
42+
val implementation by configurations
43+
val testImplementation by configurations
44+
val compileOnly by configurations
45+
val annotationProcessor by configurations
46+
47+
dependencies {
48+
compileOnly("org.slf4j:slf4j-api:$slf4jVersion")
49+
compileOnly("org.projectlombok:lombok:$lombokVersion")
50+
implementation("ch.qos.logback:logback-classic:$logbackVersion")
51+
annotationProcessor("org.slf4j:slf4j-api:$slf4jVersion")
52+
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
53+
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
54+
}
55+
56+
repositories {
57+
mavenLocal()
58+
maven(url = "https://codecrafters.coding.net/public-artifacts/base/public/packages/")
59+
maven(url = "https://maven.proxy.ustclug.org.cn/maven2/")
60+
mavenCentral()
61+
}
62+
63+
tasks.withType<JavaCompile> {
64+
options.encoding = "UTF-8"
65+
}
66+
}

devkit-core/build.gradle.kts

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import java.net.URI
2+
3+
val globalGroupId: String by rootProject.extra
4+
val globalVersion: String by rootProject.extra
5+
val projectUrl: String by rootProject.extra
6+
val projectGithubUrl: String by rootProject.extra
7+
val licenseName: String by rootProject.extra
8+
val licenseUrl: String by rootProject.extra
9+
10+
group = globalGroupId
11+
version = globalVersion
12+
13+
java {
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
16+
withSourcesJar()
17+
withJavadocJar()
18+
}
19+
20+
tasks.test {
21+
useJUnitPlatform()
22+
}
23+
24+
publishing {
25+
publications {
26+
create<MavenPublication>("devkitCore") {
27+
groupId = globalGroupId
28+
artifactId = "devkit-core"
29+
version = globalVersion
30+
31+
pom {
32+
name = "DevKit - Core"
33+
description = "The core module of JDevKit."
34+
url = projectUrl
35+
36+
licenses {
37+
license {
38+
name = licenseName
39+
url = licenseUrl
40+
}
41+
}
42+
43+
scm {
44+
connection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
45+
developerConnection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
46+
url = projectGithubUrl
47+
}
48+
49+
developers {
50+
developer {
51+
id = "zihluwang"
52+
name = "Zihlu Wang"
53+
email = "really@zihlu.wang"
54+
timezone = "Asia/Hong_Kong"
55+
}
56+
}
57+
}
58+
59+
from(components["java"])
60+
61+
signing {
62+
sign(publishing.publications["devkitCore"])
63+
}
64+
}
65+
66+
repositories {
67+
maven {
68+
name = "sonatypeNexus"
69+
url = URI(providers.gradleProperty("repo.maven-central.username").get())
70+
credentials {
71+
username = providers.gradleProperty("repo.maven-central.username").get()
72+
password = providers.gradleProperty("repo.maven-central.password").get()
73+
}
74+
}
75+
76+
maven {
77+
name = "codingNexus"
78+
url = URI(providers.gradleProperty("repo.coding.host").get())
79+
credentials {
80+
username = providers.gradleProperty("repo.coding.username").get()
81+
password = providers.gradleProperty("repo.coding.password").get()
82+
}
83+
}
84+
85+
maven {
86+
name = "githubPackages"
87+
url = URI(providers.gradleProperty("repo.github.host").get())
88+
credentials {
89+
username = providers.gradleProperty("repo.github.username").get()
90+
password = providers.gradleProperty("repo.github.password").get()
91+
}
92+
}
93+
}
94+
}
95+
}

devkit-core/pom.xml

Lines changed: 0 additions & 37 deletions
This file was deleted.

devkit-utils/build.gradle.kts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import java.net.URI
2+
3+
val globalGroupId: String by rootProject.extra
4+
val globalVersion: String by rootProject.extra
5+
val projectUrl: String by rootProject.extra
6+
val projectGithubUrl: String by rootProject.extra
7+
val licenseName: String by rootProject.extra
8+
val licenseUrl: String by rootProject.extra
9+
10+
group = globalGroupId
11+
version = globalVersion
12+
13+
dependencies {
14+
implementation(project(":devkit-core"))
15+
}
16+
17+
java {
18+
sourceCompatibility = JavaVersion.VERSION_17
19+
targetCompatibility = JavaVersion.VERSION_17
20+
withSourcesJar()
21+
withJavadocJar()
22+
}
23+
24+
tasks.test {
25+
useJUnitPlatform()
26+
}
27+
28+
publishing {
29+
publications {
30+
create<MavenPublication>("devkitUtils") {
31+
groupId = globalGroupId
32+
artifactId = "devkit-utils"
33+
version = globalVersion
34+
35+
pom {
36+
name = "DevKit - Utils"
37+
description = "The utils module of JDevKit."
38+
url = projectUrl
39+
40+
licenses {
41+
license {
42+
name = licenseName
43+
url = licenseUrl
44+
}
45+
}
46+
47+
scm {
48+
connection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
49+
developerConnection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
50+
url = projectGithubUrl
51+
}
52+
53+
developers {
54+
developer {
55+
id = "zihluwang"
56+
name = "Zihlu Wang"
57+
email = "really@zihlu.wang"
58+
timezone = "Asia/Hong_Kong"
59+
}
60+
}
61+
}
62+
63+
from(components["java"])
64+
65+
signing {
66+
sign(publishing.publications["devkitUtils"])
67+
}
68+
}
69+
70+
repositories {
71+
maven {
72+
name = "sonatypeNexus"
73+
url = URI(providers.gradleProperty("repo.maven-central.host").get())
74+
credentials {
75+
username = providers.gradleProperty("repo.maven-central.username").get()
76+
password = providers.gradleProperty("repo.maven-central.password").get()
77+
}
78+
}
79+
80+
maven {
81+
name = "codingNexus"
82+
url = URI(providers.gradleProperty("repo.coding.host").get())
83+
credentials {
84+
username = providers.gradleProperty("repo.coding.username").get()
85+
password = providers.gradleProperty("repo.coding.password").get()
86+
}
87+
}
88+
89+
maven {
90+
name = "githubPackages"
91+
url = URI(providers.gradleProperty("repo.github.host").get())
92+
credentials {
93+
username = providers.gradleProperty("repo.github.username").get()
94+
password = providers.gradleProperty("repo.github.password").get()
95+
}
96+
}
97+
}
98+
}
99+
}

devkit-utils/pom.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

gradle.properties

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (C) 2023 CodeCraftersCN.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
#
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
logbackVersion=1.4.13
19+
junitVersion=5.10.1
20+
slf4jVersion=2.0.9
21+
lombokVersion=1.18.30
22+
jacksonVersion=2.16.0
23+
javaJwtVersion=4.4.0
24+
jjwtVersion=0.12.3
25+
okhttpVersion=4.12.0
26+
springVersion=6.1.1
27+
springBootVersion=3.2.0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (C) 2023 CodeCraftersCN.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
#
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Wed 31 Jan 00:00:00 HKT 2024
19+
distributionBase=GRADLE_USER_HOME
20+
distributionPath=wrapper/dists
21+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
22+
zipStoreBase=GRADLE_USER_HOME
23+
zipStorePath=wrapper/dists

gradlew

Whitespace-only changes.

gradlew.bat

Whitespace-only changes.

0 commit comments

Comments
 (0)