-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (71 loc) · 2.08 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
apply plugin: 'groovy'
group = 'org.modelcatalogue'
version = '0.1.3'
description = 'Simple Fixtures not only for Grails projects'
repositories {
jcenter()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.2.1'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'junit:junit:4.10'
}
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}
// code below this can be safely removed if you don't want publish library ever
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3'
}
}
apply plugin: 'maven-publish'
apply plugin: 'bintray'
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 {
repo = 'model-catalogue' // or your repo name
userOrg = 'metadata'
name = projectName // somehow project.* doesn't work in this closure
desc = projectDescription
licenses = ['MIT']
}
// dryRun = true // whether to run this as dry-run, without deploying
}
String getPropertyOrUseDefault(String propertyName, String defaultValue) {
hasProperty(propertyName) ? getProperty(propertyName) : defaultValue
}
// 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
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}