Skip to content

Commit

Permalink
gradle version up test(samunohito#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoepsilonix committed Nov 11, 2024
1 parent 400608d commit d88f61d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: 17
- name: Set up Rust
run: |
rustup toolchain install stable --profile minimal
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Wed Jan 01 14:26:11 JST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
133 changes: 60 additions & 73 deletions kanaria_jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,105 +1,92 @@
import java.nio.file.Files
import java.nio.file.Paths



plugins {
maven
`maven-publish`
`kotlin-dsl`
id("org.jetbrains.dokka") version "0.10.0"
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "1.9.20"
id("com.osm.gradle.plugins.rustic") version "0.2.7"
}

val GITHUB_URL = "https://github.com/samunohito/kanaria"
group = "com.kanaria"
version = "0.2.0"
version = "0.2.1"

dependencies {
"implementation"(group = "jaxen", name = "jaxen", version = "1.1.6")
"implementation"(group = "org.dom4j", name = "dom4j", version = "2.1.1")
"implementation"(group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8")
"testImplementation"(group = "junit", name = "junit", version = "4.12")
"testImplementation"(group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version = "1.3.21")
"implementation"(group = "jaxen", name = "jaxen", version = "2.0.0")
"implementation"(group = "org.dom4j", name = "dom4j", version = "2.1.4")
"testImplementation"(group = "junit", name = "junit", version = "4.13.2")
"testImplementation"(group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version = "2.0.21")
}

tasks {
val dokka by getting(org.jetbrains.dokka.gradle.DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
}
tasks.dokkaHtml {
outputDirectory.set(layout.buildDirectory.dir("javadoc"))
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
getByName("test").java.srcDirs("src/test/kotlin")
}

tasks {
getByName("javadoc", Javadoc::class) {
options.locale = "ja_JP"
isFailOnError = false
source = sourceSets["main"].allJava
main {
java.srcDirs("src/main/kotlin")
}

val sourcesJar by creating(Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
test {
java.srcDirs("src/test/kotlin")
}
}
}

val javadocJar by creating(Jar::class) {
dependsOn(JavaPlugin.JAVADOC_TASK_NAME)
archiveClassifier.set("javadoc")
from(getByName("javadoc", Javadoc::class).destinationDir)
}
tasks {
named<Javadoc>("javadoc") {
options.locale = "ja_JP"
isFailOnError = false
source = sourceSets["main"].allJava
}

artifacts {
add("archives", sourcesJar)
add("archives", javadocJar)
}
register<Jar>("sourcesJar") {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
}

bintray {
user = if (project.hasProperty("bintray_user")) project.properties["bintray_user"].toString() else ""
key = if (project.hasProperty("bintray_apikey")) project.properties["bintray_apikey"].toString() else ""
pkg.apply {
repo = "maven"
name = "${project.group}.${project.name}"
websiteUrl = GITHUB_URL
issueTrackerUrl = "${GITHUB_URL}/issues"
vcsUrl = "${GITHUB_URL}.git"
publicDownloadNumbers = true
setVersion(project.version)
register<Jar>("javadocJar") {
dependsOn(JavaPlugin.JAVADOC_TASK_NAME)
archiveClassifier.set("javadoc")
from(named<Javadoc>("javadoc").get().destinationDir)
}
setConfigurations("archives")
}

tasks.getByName("install", Upload::class) {
repositories.withGroovyBuilder {
"mavenInstaller" {
"pom" {
"project" {
setProperty("groupId", project.group)
setProperty("artifactId", project.name)
setProperty("version", project.version)

"licenses" {
"license" {
setProperty("name", "The MIT License")
setProperty("url", "https://opensource.org/licenses/MIT")
setProperty("distribution", "repo")
}
}
artifacts {
add("archives", tasks["sourcesJar"])
add("archives", tasks["javadocJar"])
}

"scm" {
setProperty("connection", "${GITHUB_URL}.git")
setProperty("url", GITHUB_URL)
publishing {
publications {
create<MavenPublication>("maven") {
pom {
name.set("${project.group}.${project.name}")
description.set("This library provides functions such as hiragana, katakana, half-width and full-width mutual conversion and discrimination.")
url.set(GITHUB_URL)
licenses {
license {
name.set("MIT License")
url.set("${GITHUB_URL}/blob/develop/LICENSE.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("samunohito")
name.set("samunohito")
email.set("[email protected]")
}
}
scm {
url.set("${GITHUB_URL}.git")
}
}
}
}
Expand Down

0 comments on commit d88f61d

Please sign in to comment.