-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
105 lines (88 loc) · 2.71 KB
/
build.gradle
File metadata and controls
105 lines (88 loc) · 2.71 KB
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
101
102
103
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "com.jfrog.bintray"
apply plugin: 'maven-publish'
archivesBaseName = 'configparser'
repositories {
jcenter()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile "org.spockframework:spock-core:$spockVersion"
}
jar {
manifest {
attributes(
'Bundle-ManifestVersion': '2',
'Bundle-Name': 'ConfigParser',
'Bundle-SymbolicName': 'org.codehaus.groovy.util.configparser',
'Bundle-Version': "$version.0.xx-${new Date().format('yyyyMMdd')}",
'Bundle-RequiredExecutionEnvironment': 'JavaSE-1.7',
'Export-Package': 'groovy.util',
'Require-Bundle': 'org.codehaus.groovy;bundle-version="2.4.12"'
)
}
}
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
}
def projectName = project.name
def projectDescription = """\
An extension and drop in replacement for groovy.util.ConfigSlurper.
Features are:
- Calling Closures in binding like methods
- Nicer syntax for hybrid keys (ones with both, children and a value)
- Java-friendly API
- Delegate for parsing
- Multiple conditional blocks
- ConfigLazy for lazy evaluation of values
- ConfigFactory for factory created values
- Checking for existance of a key does not create a new, empty entry
"""
publishing {
publications {
groovyMaven(MavenPublication) {
from components.java
groupId group
artifactId projectName
version version
artifact sourcesJar
artifact javadocJar
}
}
}
// set bintrayUser & bintrayKey in gradle.properties
bintray {
user = getPropertyOrUseDefault("bintrayUser", "fake_user")
key = getPropertyOrUseDefault("bintrayKey", "fake_key")
pkg {
repo = 'configparser'
name = projectName
userOrg = 'karfunkel'
desc = projectDescription
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/karfunkel/ConfigParser.git'
}
publications = ['groovyMaven']
dryRun = false // whether to run this as dry-run, without deploying
}
String getPropertyOrUseDefault(String propertyName, String defaultValue) {
hasProperty(propertyName) ? getProperty(propertyName) : defaultValue
}