OSDN Git Service

Prepare to publish on maven
[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
15   sourceCompatibility = jdkVersion
16   targetCompatibility = jdkVersion
17   [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
18   [compileJava, compileTestJava]*.options*.bootClasspath = "$JDK_HOME/jre/lib/rt.jar"
19   checkstyle {
20     config = resources.text.fromFile("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
21     ignoreFailures = true
22     toolVersion = '6.16.1'
23   }
24
25   // Force prevent checkstyle/findbugs on Test.
26   task checkstyleTest(overwrite: true) << {}
27   task findbugsTest(overwrite: true) << {}
28   tasks.withType(FindBugs) {
29     reports {
30       xml.enabled = false
31       html.enabled = true
32     }
33   }
34
35   repositories {
36     jcenter()
37     maven {
38         url "http://dl.bintray.com/miurahr/maven"
39     }
40     mavenCentral()
41   }
42
43   dependencies {
44     testCompile 'org.testng:testng:6.9.10'
45   }
46
47   test {
48     useTestNG()
49   }
50 }
51
52 group = projectGroup
53 version = projectVersion
54
55 project(':dictzip-lib') {
56   dependencies {
57     testCompile 'tokyo.northside:northside-io:0.2.0'
58   }
59 }
60
61 project(':dictzip-cli') {
62   apply plugin: 'application'
63   mainClassName = 'org.dict.zip.cli.Main'
64   applicationName = 'DictZip'
65
66   dependencies {
67     compile project(':dictzip-lib'),
68        'commons-codec:commons-codec:1.10',
69        'gnu.getopt:java-getopt:1.0.13'
70     testCompile 'tokyo.northside:northside-io:0.2.0'
71   }
72 }
73
74 if (gradle.startParameter.taskNames.contains('uploadArchives') ||
75     gradle.startParameter.taskNames.contains('bintrayUpload')  ||
76     gradle.startParameter.taskNames.contains('githubRelease)) {
77   apply from: 'build.publish.gradle'
78 }