From 5e31565dd247060f8296f8371d80097e67c047b6 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Wed, 31 Jan 2024 02:43:17 +0800 Subject: [PATCH] build: Changed toolchain to gradle. --- build.gradle.kts | 66 +++ devkit-core/build.gradle.kts | 95 ++++ devkit-core/pom.xml | 37 -- devkit-utils/build.gradle.kts | 99 ++++ devkit-utils/pom.xml | 27 - gradle.properties | 27 + gradle/wrapper/gradle-wrapper.properties | 23 + gradlew | 0 gradlew.bat | 0 guid/build.gradle.kts | 99 ++++ guid/pom.xml | 44 -- pom.xml | 513 ------------------ .../build.gradle.kts | 113 ++++ property-guard-spring-boot-starter/pom.xml | 65 --- settings.gradle.kts | 30 + simple-jwt-authzero/build.gradle.kts | 108 ++++ simple-jwt-authzero/pom.xml | 54 -- simple-jwt-facade/build.gradle.kts | 108 ++++ simple-jwt-facade/pom.xml | 54 -- simple-jwt-jjwt/build.gradle.kts | 111 ++++ simple-jwt-jjwt/pom.xml | 69 --- .../build.gradle.kts | 133 +++++ simple-jwt-spring-boot-starter/pom.xml | 101 ---- webcal/build.gradle.kts | 99 ++++ webcal/pom.xml | 37 -- 25 files changed, 1111 insertions(+), 1001 deletions(-) create mode 100644 build.gradle.kts create mode 100644 devkit-core/build.gradle.kts delete mode 100644 devkit-core/pom.xml create mode 100644 devkit-utils/build.gradle.kts delete mode 100644 devkit-utils/pom.xml create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 guid/build.gradle.kts delete mode 100644 guid/pom.xml delete mode 100644 pom.xml create mode 100644 property-guard-spring-boot-starter/build.gradle.kts delete mode 100644 property-guard-spring-boot-starter/pom.xml create mode 100644 settings.gradle.kts create mode 100644 simple-jwt-authzero/build.gradle.kts delete mode 100644 simple-jwt-authzero/pom.xml create mode 100644 simple-jwt-facade/build.gradle.kts delete mode 100644 simple-jwt-facade/pom.xml create mode 100644 simple-jwt-jjwt/build.gradle.kts delete mode 100644 simple-jwt-jjwt/pom.xml create mode 100644 simple-jwt-spring-boot-starter/build.gradle.kts delete mode 100644 simple-jwt-spring-boot-starter/pom.xml create mode 100644 webcal/build.gradle.kts delete mode 100644 webcal/pom.xml diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..a8ef16c --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,66 @@ +/* + * 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.3") +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 +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: 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 + + 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") + testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion") + } + + 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 { + options.encoding = "UTF-8" + } +} \ No newline at end of file diff --git a/devkit-core/build.gradle.kts b/devkit-core/build.gradle.kts new file mode 100644 index 0000000..0df65d1 --- /dev/null +++ b/devkit-core/build.gradle.kts @@ -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("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.username").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() + } + } + } + } +} \ No newline at end of file diff --git a/devkit-core/pom.xml b/devkit-core/pom.xml deleted file mode 100644 index 7dec29c..0000000 --- a/devkit-core/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - devkit-core - - - 17 - 17 - UTF-8 - - - \ No newline at end of file diff --git a/devkit-utils/build.gradle.kts b/devkit-utils/build.gradle.kts new file mode 100644 index 0000000..1df3520 --- /dev/null +++ b/devkit-utils/build.gradle.kts @@ -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("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() + } + } + } + } +} \ No newline at end of file diff --git a/devkit-utils/pom.xml b/devkit-utils/pom.xml deleted file mode 100644 index dffd983..0000000 --- a/devkit-utils/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - devkit-utils - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - devkit-core - - - - \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6f6335b --- /dev/null +++ b/gradle.properties @@ -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.12.3 +okhttpVersion=4.12.0 +springVersion=6.1.1 +springBootVersion=3.2.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..f917880 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,23 @@ +# +# 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. +# + +# Wed 31 Jan 00:00:00 HKT 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..e69de29 diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e69de29 diff --git a/guid/build.gradle.kts b/guid/build.gradle.kts new file mode 100644 index 0000000..e56c8bc --- /dev/null +++ b/guid/build.gradle.kts @@ -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("guid") { + groupId = globalGroupId + artifactId = "guid" + version = globalVersion + + pom { + name = "DevKit - GUID" + description = "The guid 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["guid"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/guid/pom.xml b/guid/pom.xml deleted file mode 100644 index 4faf31a..0000000 --- a/guid/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - guid - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - devkit-core - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index fd66d6f..0000000 --- a/pom.xml +++ /dev/null @@ -1,513 +0,0 @@ - - - - - 4.0.0 - - - org.sonatype.oss - oss-parent - 9 - - - cn.org.codecrafters - jdevkit - 1.2.2 - 2023 - - pom - - devkit-core - devkit-utils - guid - webcal - simple-jwt-facade - simple-jwt-authzero - simple-jwt-jjwt - simple-jwt-spring-boot-starter - property-guard-spring-boot-starter - - - - CodeCrafters - https://codecrafters.org.cn - - - - - zihluwang - Zihlu Wang - zihlu.wang@codecrafters.org.cn - CodeCraftersCN - https://codecrafters.org.cn - - - - - - The Apache Software License, Version 2.0 - https://www.apache.org/licenses/ - repo - - - - - https://github.com/CodeCraftersCN/jdevkit - git@github.com:CodeCraftersCN/jdevkit.git - https://github.com/CodeCraftersCN/jdevkit - - - - 17 - 17 - UTF-8 - - - 3.3.0 - 3.5.0 - 3.1.0 - 3.3.0 - - - 1.4.13 - 5.10.0 - 2.0.9 - 1.18.30 - 2.15.2 - 4.4.0 - 0.11.5 - 4.11.0 - - - 6.0.9 - 3.1.0 - - - - - - - org.junit - junit-bom - ${junit.version} - pom - import - - - - - org.slf4j - slf4j-api - ${slf4j-api.version} - - - - - ch.qos.logback - logback-classic - ${logback.version} - - - - - org.projectlombok - lombok - ${lombok.version} - - - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - - - com.auth0 - java-jwt - ${auth0-jwt.version} - - - - - io.jsonwebtoken - jjwt-api - ${jjwt-jwt.version} - - - - io.jsonwebtoken - jjwt-impl - ${jjwt-jwt.version} - runtime - - - - io.jsonwebtoken - jjwt-jackson - ${jjwt-jwt.version} - runtime - - - com.fasterxml.jackson.core - jackson-databind - - - - - - com.squareup.okhttp3 - okhttp - 4.11.0 - - - - - cn.org.codecrafters - devkit-core - ${project.version} - - - - cn.org.codecrafters - guid - ${project.version} - - - - cn.org.codecrafters - devkit-utils - ${project.version} - - - - cn.org.codecrafters - simple-jwt-facade - ${project.version} - - - - cn.org.codecrafters - simple-jwt-authzero - ${project.version} - - - - cn.org.codecrafters - simple-jwt-jjwt - ${project.version} - - - - - org.springframework.boot - spring-boot-autoconfigure - ${spring-boot.version} - - - - org.springframework.boot - spring-boot-starter-logging - ${spring-boot.version} - - - - org.springframework.boot - spring-boot-configuration-processor - ${spring-boot.version} - - - - org.springframework.boot - spring-boot-starter-test - test - ${spring-boot.version} - - - - - - - org.junit.jupiter - junit-jupiter - test - - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - - - - org.projectlombok - lombok - - - - - - maven-central - - - - org.apache.maven.plugins - maven-source-plugin - ${source-plugin.version} - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${gpg-plugin.version} - - - verify - - sign - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${jar-plugin.version} - - - *.xml - - - - - - - - maven-snapshot - https://s01.oss.sonatype.org/content/repositories/snapshots/ - - - maven - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - github - - - - org.apache.maven.plugins - maven-source-plugin - ${source-plugin.version} - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${gpg-plugin.version} - - - verify - - sign - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${jar-plugin.version} - - - *.xml - - - - - - - - github - https://maven.pkg.github.com/CodeCraftersCN/jdevkit - - - - - - local - - - - org.apache.maven.plugins - maven-source-plugin - ${source-plugin.version} - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${jar-plugin.version} - - - *.xml - - - - - - - - - coding - - - - org.apache.maven.plugins - maven-source-plugin - ${source-plugin.version} - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${gpg-plugin.version} - - - verify - - sign - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${jar-plugin.version} - - - *.xml - - - - - - - - codecrafters-general-public - public - https://codecrafters-maven.pkg.coding.net/repository/general/public/ - - - - - - \ No newline at end of file diff --git a/property-guard-spring-boot-starter/build.gradle.kts b/property-guard-spring-boot-starter/build.gradle.kts new file mode 100644 index 0000000..2d72020 --- /dev/null +++ b/property-guard-spring-boot-starter/build.gradle.kts @@ -0,0 +1,113 @@ +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 + +val logbackVersion: String by project +val junitVersion: String by project +val slf4jVersion: String by project +val lombokVersion: String by project +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: String by project + +group = globalGroupId +version = globalVersion + +dependencies { + implementation(project(":devkit-utils")) + implementation("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion") + implementation("org.springframework.boot:spring-boot-starter-logging:$springBootVersion") + implementation("org.springframework.boot:spring-boot-configuration-processor:$springBootVersion") + testImplementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion") +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() +} + +tasks.test { + useJUnitPlatform() +} + +publishing { + publications { + create("propertyGuardSpringBootStarter") { + groupId = globalGroupId + artifactId = "property-guard-spring-boot-starter" + version = globalVersion + + pom { + name = "Property Guard Spring Boot Starter" + 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["propertyGuardSpringBootStarter"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/property-guard-spring-boot-starter/pom.xml b/property-guard-spring-boot-starter/pom.xml deleted file mode 100644 index b563253..0000000 --- a/property-guard-spring-boot-starter/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - property-guard-spring-boot-starter - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - devkit-utils - - - - org.springframework.boot - spring-boot-autoconfigure - - - - org.springframework.boot - spring-boot-starter-logging - - - - org.springframework.boot - spring-boot-configuration-processor - - - - org.springframework.boot - spring-boot-starter-test - test - - - - \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..3ebbcb8 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +rootProject.name = "JDevKit" + +include( + "devkit-core", + "devkit-utils", + "guid", + "webcal", + "simple-jwt-facade", + "simple-jwt-authzero", + "simple-jwt-jjwt", + "simple-jwt-spring-boot-starter", + "property-guard-spring-boot-starter" +) \ No newline at end of file diff --git a/simple-jwt-authzero/build.gradle.kts b/simple-jwt-authzero/build.gradle.kts new file mode 100644 index 0000000..39f387c --- /dev/null +++ b/simple-jwt-authzero/build.gradle.kts @@ -0,0 +1,108 @@ +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 + +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: String by project + +group = globalGroupId +version = globalVersion + +dependencies { + implementation(project(":simple-jwt-facade")) + implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") + implementation("com.auth0:java-jwt:$javaJwtVersion") +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() +} + +tasks.test { + useJUnitPlatform() +} + +publishing { + publications { + create("simpleJwtAuthzero") { + groupId = globalGroupId + artifactId = "simple-jwt-authzero" + version = globalVersion + + pom { + name = "Simple JWT :: Auth0" + description = "The implementation of Simple JWT using com.auth0 library." + 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["simpleJwtAuthzero"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/simple-jwt-authzero/pom.xml b/simple-jwt-authzero/pom.xml deleted file mode 100644 index fa745a1..0000000 --- a/simple-jwt-authzero/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - simple-jwt-authzero - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - simple-jwt-facade - - - - com.fasterxml.jackson.core - jackson-databind - - - - com.auth0 - java-jwt - - - - \ No newline at end of file diff --git a/simple-jwt-facade/build.gradle.kts b/simple-jwt-facade/build.gradle.kts new file mode 100644 index 0000000..5619929 --- /dev/null +++ b/simple-jwt-facade/build.gradle.kts @@ -0,0 +1,108 @@ +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 + +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: String by project + +group = globalGroupId +version = globalVersion + +dependencies { + implementation(project(":devkit-core")) + implementation(project(":devkit-utils")) + implementation(project(":guid")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() +} + +tasks.test { + useJUnitPlatform() +} + +publishing { + publications { + create("simpleJwtFacade") { + groupId = globalGroupId + artifactId = "simple-jwt-facade" + version = globalVersion + + pom { + name = "Simple JWT :: Facade" + description = "The facade of Simple JWT." + 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["simpleJwtFacade"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/simple-jwt-facade/pom.xml b/simple-jwt-facade/pom.xml deleted file mode 100644 index 6113b84..0000000 --- a/simple-jwt-facade/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - simple-jwt-facade - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - devkit-core - - - - cn.org.codecrafters - devkit-utils - - - - cn.org.codecrafters - guid - - - - \ No newline at end of file diff --git a/simple-jwt-jjwt/build.gradle.kts b/simple-jwt-jjwt/build.gradle.kts new file mode 100644 index 0000000..07bce29 --- /dev/null +++ b/simple-jwt-jjwt/build.gradle.kts @@ -0,0 +1,111 @@ +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 + +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: String by project + +group = globalGroupId +version = globalVersion + +dependencies { + implementation(project(":devkit-utils")) + implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") + implementation("io.jsonwebtoken:jjwt-api:$jjwtVersion") + implementation("io.jsonwebtoken:jjwt-impl:$jjwtVersion") + implementation("io.jsonwebtoken:jjwt-jackson:$jjwtVersion") + implementation(project(":simple-jwt-facade")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() +} + +tasks.test { + useJUnitPlatform() +} + +publishing { + publications { + create("simpleJwtJjwt") { + groupId = globalGroupId + artifactId = "simple-jwt-jjwt" + version = globalVersion + + pom { + name = "Simple JWT :: JJWT" + description = "Simple JWT implemented by io.jsonwebtoken:jjwt library." + 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["simpleJwtJjwt"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/simple-jwt-jjwt/pom.xml b/simple-jwt-jjwt/pom.xml deleted file mode 100644 index 79f5dbd..0000000 --- a/simple-jwt-jjwt/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - simple-jwt-jjwt - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - devkit-utils - - - - com.fasterxml.jackson.core - jackson-databind - - - - io.jsonwebtoken - jjwt-api - - - - io.jsonwebtoken - jjwt-impl - - - - io.jsonwebtoken - jjwt-jackson - - - - cn.org.codecrafters - simple-jwt-facade - - - - \ No newline at end of file diff --git a/simple-jwt-spring-boot-starter/build.gradle.kts b/simple-jwt-spring-boot-starter/build.gradle.kts new file mode 100644 index 0000000..466e5c0 --- /dev/null +++ b/simple-jwt-spring-boot-starter/build.gradle.kts @@ -0,0 +1,133 @@ +/* + * 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. + */ + +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 + +val jacksonVersion: String by project +val javaJwtVersion: String by project +val jjwtVersion: String by project +val okhttpVersion: String by project +val springVersion: String by project +val springBootVersion: String by project + +group = globalGroupId +version = globalVersion + +dependencies { + implementation(project(":simple-jwt-facade")) + compileOnly("com.auth0:java-jwt:$javaJwtVersion") + compileOnly(project(":simple-jwt-authzero")) + compileOnly("io.jsonwebtoken:jjwt-api:$jjwtVersion") + compileOnly("io.jsonwebtoken:jjwt-impl:$jjwtVersion") + compileOnly("io.jsonwebtoken:jjwt-jackson:$jjwtVersion") + compileOnly(project(":simple-jwt-jjwt")) + implementation("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion") + implementation("org.springframework.boot:spring-boot-starter-logging:$springBootVersion") + implementation("org.springframework.boot:spring-boot-configuration-processor:$springBootVersion") + testImplementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion") +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() +} + +tasks.test { + useJUnitPlatform() +} + +publishing { + publications { + create("guid") { + groupId = globalGroupId + artifactId = "guid" + version = globalVersion + + pom { + name = "DevKit - GUID" + description = "The guid 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["guid"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/simple-jwt-spring-boot-starter/pom.xml b/simple-jwt-spring-boot-starter/pom.xml deleted file mode 100644 index 0bb9514..0000000 --- a/simple-jwt-spring-boot-starter/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - simple-jwt-spring-boot-starter - - - 17 - 17 - UTF-8 - - - - - cn.org.codecrafters - simple-jwt-facade - - - - com.auth0 - java-jwt - provided - - - - cn.org.codecrafters - simple-jwt-authzero - provided - - - - io.jsonwebtoken - jjwt-api - provided - - - - io.jsonwebtoken - jjwt-impl - provided - - - - io.jsonwebtoken - jjwt-jackson - provided - - - - cn.org.codecrafters - simple-jwt-jjwt - provided - - - - org.springframework.boot - spring-boot-autoconfigure - - - - org.springframework.boot - spring-boot-starter-logging - - - - org.springframework.boot - spring-boot-configuration-processor - - - - org.springframework.boot - spring-boot-starter-test - test - - - - \ No newline at end of file diff --git a/webcal/build.gradle.kts b/webcal/build.gradle.kts new file mode 100644 index 0000000..e56c8bc --- /dev/null +++ b/webcal/build.gradle.kts @@ -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("guid") { + groupId = globalGroupId + artifactId = "guid" + version = globalVersion + + pom { + name = "DevKit - GUID" + description = "The guid 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["guid"]) + } + } + + 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() + } + } + } + } +} \ No newline at end of file diff --git a/webcal/pom.xml b/webcal/pom.xml deleted file mode 100644 index 368f2eb..0000000 --- a/webcal/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - 4.0.0 - - cn.org.codecrafters - jdevkit - 1.2.2 - - - webcal - - - 17 - 17 - UTF-8 - - - \ No newline at end of file