Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ build/
.vscode/

### Mac OS ###
.DS_Store
.DS_Store

### Gradle ###
.gradle
67 changes: 67 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2023 CodeCraftersCN.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/

val projectUrl by extra("https://codecrafters.org.cn/JDevKit")
val projectGithubUrl by extra("https://github.com/CodeCraftersCN/JDevKit")
val globalGroupId by extra("cn.org.codecrafters")
val globalVersion by extra("1.2.2-gradle")
val licenseName by extra("The Apache License, Version 2.0")
val licenseUrl by extra("https://www.apache.org/licenses/LICENSE-2.0.txt")

val logbackVersion: String by project
val junitVersion: String by project
val slf4jVersion: String by project
val lombokVersion: String by project

subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")

val implementation by configurations
val testImplementation by configurations
val compileOnly by configurations
val annotationProcessor by configurations
val testAnnotationProcessor by configurations
val testCompileOnly by configurations

dependencies {
compileOnly("org.slf4j:slf4j-api:$slf4jVersion")
compileOnly("org.projectlombok:lombok:$lombokVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
annotationProcessor("org.slf4j:slf4j-api:$slf4jVersion")
annotationProcessor("org.projectlombok:lombok:$lombokVersion")

testCompileOnly("org.slf4j:slf4j-api:$slf4jVersion")
testCompileOnly("org.projectlombok:lombok:$lombokVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testAnnotationProcessor("org.slf4j:slf4j-api:$slf4jVersion")
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
}

repositories {
mavenLocal()
maven(url = "https://codecrafters.coding.net/public-artifacts/base/public/packages/")
maven(url = "https://maven.proxy.ustclug.org.cn/maven2/")
mavenCentral()
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
}
95 changes: 95 additions & 0 deletions devkit-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import java.net.URI

val globalGroupId: String by rootProject.extra
val globalVersion: String by rootProject.extra
val projectUrl: String by rootProject.extra
val projectGithubUrl: String by rootProject.extra
val licenseName: String by rootProject.extra
val licenseUrl: String by rootProject.extra

group = globalGroupId
version = globalVersion

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}

tasks.test {
useJUnitPlatform()
}

publishing {
publications {
create<MavenPublication>("devkitCore") {
groupId = globalGroupId
artifactId = "devkit-core"
version = globalVersion

pom {
name = "DevKit - Core"
description = "The core module of JDevKit."
url = projectUrl

licenses {
license {
name = licenseName
url = licenseUrl
}
}

scm {
connection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
developerConnection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
url = projectGithubUrl
}

developers {
developer {
id = "zihluwang"
name = "Zihlu Wang"
email = "really@zihlu.wang"
timezone = "Asia/Hong_Kong"
}
}
}

from(components["java"])

signing {
sign(publishing.publications["devkitCore"])
}
}

repositories {
maven {
name = "sonatypeNexus"
url = URI(providers.gradleProperty("repo.maven-central.host").get())
credentials {
username = providers.gradleProperty("repo.maven-central.username").get()
password = providers.gradleProperty("repo.maven-central.password").get()
}
}

maven {
name = "codingNexus"
url = URI(providers.gradleProperty("repo.coding.host").get())
credentials {
username = providers.gradleProperty("repo.coding.username").get()
password = providers.gradleProperty("repo.coding.password").get()
}
}

maven {
name = "githubPackages"
url = URI(providers.gradleProperty("repo.github.host").get())
credentials {
username = providers.gradleProperty("repo.github.username").get()
password = providers.gradleProperty("repo.github.password").get()
}
}
}
}
}
37 changes: 0 additions & 37 deletions devkit-core/pom.xml

This file was deleted.

99 changes: 99 additions & 0 deletions devkit-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import java.net.URI

val globalGroupId: String by rootProject.extra
val globalVersion: String by rootProject.extra
val projectUrl: String by rootProject.extra
val projectGithubUrl: String by rootProject.extra
val licenseName: String by rootProject.extra
val licenseUrl: String by rootProject.extra

group = globalGroupId
version = globalVersion

dependencies {
implementation(project(":devkit-core"))
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}

tasks.test {
useJUnitPlatform()
}

publishing {
publications {
create<MavenPublication>("devkitUtils") {
groupId = globalGroupId
artifactId = "devkit-utils"
version = globalVersion

pom {
name = "DevKit - Utils"
description = "The utils module of JDevKit."
url = projectUrl

licenses {
license {
name = licenseName
url = licenseUrl
}
}

scm {
connection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
developerConnection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
url = projectGithubUrl
}

developers {
developer {
id = "zihluwang"
name = "Zihlu Wang"
email = "really@zihlu.wang"
timezone = "Asia/Hong_Kong"
}
}
}

from(components["java"])

signing {
sign(publishing.publications["devkitUtils"])
}
}

repositories {
maven {
name = "sonatypeNexus"
url = URI(providers.gradleProperty("repo.maven-central.host").get())
credentials {
username = providers.gradleProperty("repo.maven-central.username").get()
password = providers.gradleProperty("repo.maven-central.password").get()
}
}

maven {
name = "codingNexus"
url = URI(providers.gradleProperty("repo.coding.host").get())
credentials {
username = providers.gradleProperty("repo.coding.username").get()
password = providers.gradleProperty("repo.coding.password").get()
}
}

maven {
name = "githubPackages"
url = URI(providers.gradleProperty("repo.github.host").get())
credentials {
username = providers.gradleProperty("repo.github.username").get()
password = providers.gradleProperty("repo.github.password").get()
}
}
}
}
}
27 changes: 0 additions & 27 deletions devkit-utils/pom.xml

This file was deleted.

27 changes: 27 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright (C) 2023 CodeCraftersCN.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
#

logbackVersion=1.4.13
junitVersion=5.10.1
slf4jVersion=2.0.9
lombokVersion=1.18.30
jacksonVersion=2.16.0
javaJwtVersion=4.4.0
jjwtVersion=0.11.5
okhttpVersion=4.12.0
springVersion=6.1.1
springBootVersion=3.2.0
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading