-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
100 lines (80 loc) · 2.25 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group = 'org.duckapter'
version = '0.8.1'
sourceCompatibility=1.6
targetCompatibility=1.6
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.8.2'
}
jar {
manifest.attributes provider: 'gradle'
}
// publishing
publishing {
publications {
groovyMaven(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
}
// set bintrayUser & bintrayKey in gradle.properties
bintray {
user = getPropertyOrUseDefault('bintrayUser', 'fake_user')
key = getPropertyOrUseDefault('bintrayKey', 'fake_key')
publications = ['groovyMaven']
def projectName = project.name
def projectDescription = project.description
pkg {
websiteUrl = 'https://code.google.com/p/duckapter/'
issueTrackerUrl = 'https://github.com/musketyr/duckapter/issues'
vcsUrl = 'https://github.com/musketyr/duckapter/issues.git'
repo = 'maven' // or your repo name
userOrg = 'musketyr'
name = projectName // somehow project.* doesn't work in this closure
desc = projectDescription
licenses = ['Apache-2.0']
}
// dryRun = true // whether to run this as dry-run, without deploying
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
bintrayUpload.dependsOn test
String getPropertyOrUseDefault(String propertyName, String defaultValue) {
hasProperty(propertyName) ? getProperty(propertyName) : defaultValue
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}