OSDN Git Service

Release v0.10.1
[dictzip-java/dictzip-java.git] / build.gradle
index 0b61048..5b42cf8 100644 (file)
@@ -19,12 +19,23 @@ if (versionDetails().isCleanTag) {
     version = versionDetails().lastTag.substring(1) + '-' + versionDetails().commitDistance + '-' + versionDetails().gitHash + '-SNAPSHOT'
 }
 
+def props = project.file("dictzip-cli/src/main/resources/org/dict/zip/Version.properties")
+task writeVersionFile {
+    def folder = props.getParentFile()
+    if (!folder.exists()) {
+        folder.mkdirs()
+    }
+    props.delete()
+    props.text = "version=" + project.version
+}
+
+jar.dependsOn("writeVersionFile")
+
 // common settings
 subprojects {
     apply plugin: 'jacoco'
     apply plugin: 'java'
     apply plugin: 'checkstyle'
-    apply plugin: 'maven'
     apply plugin: 'maven-publish'
 
     [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
@@ -41,10 +52,13 @@ subprojects {
     }
 
     dependencies {
-        testImplementation 'commons-io:commons-io:2.8.0'
-        testImplementation 'org.testng:testng:7.4.0'
+        implementation "org.jetbrains:annotations:23.0.0"
+        testImplementation 'commons-io:commons-io:2.11.0'
+        testImplementation "org.junit.jupiter:junit-jupiter:5.8.2"
+    }
+    test {
+        useJUnitPlatform()
     }
-    test.useTestNG()
 
     java {
         sourceCompatibility = JavaVersion.VERSION_1_8
@@ -64,38 +78,20 @@ subprojects {
     }
 }
 
+project(':northside-io') {
+    apply plugin: 'java-library'
+    version = rootProject.version
+    dependencies {
+        implementation 'commons-io:commons-io:2.11.0'
+    }
+}
+
 project(':dictzip-lib') {
     apply plugin: 'java-library'
     version = rootProject.version
-    install {
-        repositories.mavenInstaller {
-            pom.project {
-                name = 'dictzip'
-                packaging = 'jar'
-                description = projectDesc
-                url = projectUrl
-                version = project.version
-                licenses {
-                    license {
-                        name = licenseName
-                        url = licenseUrl
-                        distribution = 'repo'
-                    }
-                }
-                scm {
-                    url = githubUrl
-                    connection = "scm:git:${githubUrl}"
-                    developerConnection = "scm:git:${githubUrl}"
-                }
-                developers {
-                    developer {
-                        id = projectOwner
-                        name = developerName
-                        email = developerEmail
-                    }
-                }
-            }
-        }
+
+    dependencies {
+        testImplementation project(':northside-io')
     }
 
     publishing {
@@ -110,8 +106,8 @@ project(':dictzip-lib') {
                     url.set(projectUrl)
                     licenses {
                         license {
-                            name.set("GNU General Public License Version 2+CE")
-                            url.set("https://www.gnu.org/licenses/old-licenses/gpl-2.0")
+                            name.set("GNU General Public License v2.0 w/Classpath exception")
+                            url.set("https://www.gnu.org/software/classpath/license.html")
                         }
                     }
                     scm {
@@ -169,6 +165,7 @@ project(':dictzip-cli') {
     dependencies {
         implementation project(':dictzip-lib')
         implementation 'gnu.getopt:java-getopt:1.0.13'
+        testImplementation project(':northside-io')
     }
     task mandoc(type: Copy) {
         from "doc/dictzip.1.in"
@@ -186,7 +183,6 @@ project(':dictzip-cli') {
 
     distributions {
         main {
-            baseName = 'dictzip'
             contents {
                 from('build/docs/dictzip.1') {
                     into 'docs/man/man1'