OSDN Git Service

CLI: Drop base64 argument and enable --test
[dictzip-java/dictzip-java.git] / build.gradle
1 plugins {
2     // github
3     id "co.riiid.gradle" version "0.4.2"
4     // bintray
5     id "com.jfrog.bintray" version "1.6"
6 }
7
8 // common settings
9 subprojects {
10   apply plugin: 'java'
11   apply plugin: 'jacoco'
12   apply plugin: 'checkstyle'
13   apply plugin: 'findbugs'
14   apply plugin: 'co.riiid.gradle'
15   apply plugin: 'com.jfrog.bintray'
16   apply plugin: 'maven'
17
18   sourceCompatibility = jdkVersion
19   targetCompatibility = jdkVersion
20   [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
21   [compileJava, compileTestJava]*.options*.bootClasspath = "$JDK_HOME/jre/lib/rt.jar"
22   checkstyle {
23     config = resources.text.fromFile("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
24     ignoreFailures = true
25     toolVersion = '6.16.1'
26   }
27
28   // Force prevent checkstyle/findbugs on Test.
29   task checkstyleTest(overwrite: true) << {}
30   task findbugsTest(overwrite: true) << {}
31   tasks.withType(FindBugs) {
32     reports {
33       xml.enabled = false
34       html.enabled = true
35     }
36   }
37
38   repositories {
39     jcenter()
40     mavenCentral()
41   }
42
43   dependencies {
44     testCompile 'org.testng:testng:6.9.10'
45   }
46
47   test {
48     useTestNG()
49   }
50
51   task sourceJar(type: Jar) {
52       from sourceSets.main.allSource
53       classifier = 'sources'
54   }
55
56   task javadocJar(type: Jar, dependsOn: javadoc) {
57       classifier = 'javadoc'
58       from javadoc.destinationDir
59   }
60
61   artifacts {
62       archives jar
63       archives sourceJar
64       archives javadocJar
65   }
66 }
67
68 project(':dictzip-lib') {
69   dependencies {
70     testCompile 'tokyo.northside:northside-io:0.2.0'
71   }
72   version = projectVersion
73   group = projectGroup
74   bintray {
75       user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
76       key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
77       configurations = ['archives']
78       pkg {
79           repo = 'maven'
80           name = 'dictzip-lib'
81           licenses = ['GPL-2.0+CE']
82           vcsUrl = projectUrl
83           labels = ['java','dictzip']
84           publicDownloadNumbers = true
85       }
86   }
87 }
88
89 project(':dictzip-cli') {
90   apply plugin: 'application'
91   mainClassName = 'org.dict.zip.cli.Main'
92   applicationName = 'DictZip'
93
94   dependencies {
95     compile project(':dictzip-lib'),
96        'gnu.getopt:java-getopt:1.0.13'
97     testCompile 'tokyo.northside:northside-io:0.2.0'
98   }
99   version = projectVersion
100   group = projectGroup
101   bintray {
102       user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
103       key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
104       configurations = ['archives']
105       pkg {
106           repo = 'maven'
107           name = 'dictzip-cli'
108           licenses = ['GPL-3.0']
109           vcsUrl = projectUrl
110           labels = ['java','dictzip']
111           publicDownloadNumbers = true
112       }
113   }
114 }
115
116 if (gradle.startParameter.taskNames.contains('bintrayUpload')  ||
117     gradle.startParameter.taskNames.contains('githubRelease')) {
118   apply from: 'build.publish.gradle'
119 }