forked from n-st/sml-serial-receiver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
140 lines (113 loc) · 2.98 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'osgi'
apply plugin: 'maven'
apply plugin: 'signing'
version = '1.0.17'
group = 'org.openmuc'
def projectName = 'jSML'
def projectNameLowerCase = 'jsml'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories { mavenCentral() }
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile files('dependencies/rxtxcomm_api-2.2pre2-11_bundle.jar')
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: project.properties.sonatypeRepository) {
authentication(userName: project.properties.sonatypeUser, password: project.properties.sonatypePass)
}
snapshotRepository(url: project.properties.sonatypeSnapshotRepository) {
authentication(userName: project.properties.sonatypeUser, password: project.properties.sonatypePass)
}
pom.project {
name projectName
packaging 'jar'
description 'jSML is a library that can be used to communicate using the Smart Message Language (SML).'
url 'http://www.openmuc.org/'
licenses {
license {
name 'GNU Lesser General Public License'
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
distribution 'repo'
}
}
scm {
url 'none'
connection 'none'
}
developers {
developer {
id 'sfeuerhahn'
name 'Stefan Feuerhahn'
}
}
}
}
}
}
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
archives javadocJar
}
signing {
if ( project.hasProperty('signing.keyId') ) {
sign configurations.archives
}
}
task copyLibs(type: Copy) {
dependsOn(configurations.default.getAllArtifacts().getBuildDependencies())
dependsOn(sourcesJar)
into "build/libsdeps"
from configurations.default
from configurations.archives.getAllArtifacts().getFiles()
}
build.dependsOn(copyLibs)
jar {
manifest {
version = project.version.replace('-','.');
name = projectName
instruction 'Export-Package', '!*.internal.*,*'
}
}
sourceSets {
sample
}
eclipse.pathVariables([GRADLE_USER_HOME:file(gradle.gradleUserHomeDir)])
tasks.eclipse.dependsOn(cleanEclipse)
task javadocs(type: Javadoc) {
source sourceSets.main.allJava
exclude '**/internal/**'
destinationDir = new File(buildDir, 'javadoc')
classpath = sourceSets.main.compileClasspath
classpath += sourceSets.main.output
}
task (tar, type: Tar) {
dependsOn(build)
dependsOn(javadocs)
compression = Compression.GZIP
into(project.archivesBaseName) {
from('./') {
include 'doc/*.txt'
include 'licenses/**'
include 'build/libsdeps/**'
include 'build/javadoc/**'
include 'build.gradle'
include 'dependencies/**'
include 'src/**'
exclude 'src/sample/java/*.class'
}
}
}