1 import org.apache.tools.ant.filters.ReplaceTokens
5 id "co.riiid.gradle" version "0.4.2"
7 id "com.jfrog.bintray" version "1.6"
13 apply plugin: 'jacoco'
14 apply plugin: 'checkstyle'
15 apply plugin: 'findbugs'
16 apply plugin: 'co.riiid.gradle'
17 apply plugin: 'com.jfrog.bintray'
20 sourceCompatibility = jdkVersion
21 targetCompatibility = jdkVersion
22 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
23 [compileJava, compileTestJava]*.options*.bootClasspath = "$JDK_HOME/jre/lib/rt.jar"
25 config = resources.text.fromFile("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
27 toolVersion = '6.16.1'
30 // Force prevent checkstyle/findbugs on Test.
31 task checkstyleTest(overwrite: true) << {}
32 task findbugsTest(overwrite: true) << {}
33 tasks.withType(FindBugs) {
46 testCompile 'org.testng:testng:6.9.10'
54 options.locale = 'en_US'
57 task sourceJar(type: Jar) {
58 from sourceSets.main.allSource
59 classifier = 'sources'
62 task javadocJar(type: Jar, dependsOn: javadoc) {
63 classifier = 'javadoc'
64 from javadoc.destinationDir
74 project(':dictzip-lib') {
76 testCompile 'tokyo.northside:northside-io:0.2.0'
78 version = projectVersion
81 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
82 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
83 configurations = ['archives']
88 licenses = ['GPL-2.0+CE']
90 labels = ['java','dictzip']
91 publicDownloadNumbers = true
95 task githubRelease(overwrite: true) << {}
98 project(':dictzip-cli') {
99 apply plugin: 'application'
100 mainClassName = 'org.dict.zip.cli.Main'
101 applicationName = 'dictzip'
104 compile project(':dictzip-lib'),
105 'gnu.getopt:java-getopt:1.0.13'
106 testCompile 'tokyo.northside:northside-io:0.2.0'
108 version = projectVersion
111 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
112 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
113 configurations = ['archives']
118 licenses = ['GPL-3.0']
120 labels = ['java','dictzip']
121 publicDownloadNumbers = true
125 task mandoc(type: Copy, overwrite: true) {
126 from "doc/dictzip.1.in"
128 rename { String fileName ->
129 fileName.replace('dictzip.1.in', 'dictzip.1')
131 filter(ReplaceTokens, tokens: [copyright: projectYears, version: projectVersion])
135 compression = Compression.GZIP
137 distTar.dependsOn mandoc
143 from('build/docs/dictzip.1') {
155 task githubRelease(overwrite: true) << {}
159 task bintrayUpload(overwrite: true) << {}
161 if (gradle.startParameter.taskNames.contains('bintrayUpload') ||
162 gradle.startParameter.taskNames.contains('githubRelease')) {
163 apply from: 'build.publish.gradle'