-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
111 lines (89 loc) · 3.14 KB
/
build.gradle
File metadata and controls
111 lines (89 loc) · 3.14 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
104
105
106
107
108
109
110
111
/* scenarioo-api
* Copyright (C) 2014, scenarioo.org Development Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules, according
* to the GNU General Public License with "Classpath" exception as provided
* in the LICENSE file that accompanied this code.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import javax.security.auth.login.ConfigurationSpi;
group = 'org.scenarioo'
artifactId = 'scenarioo-java'
version = '2.0.2-SNAPSHOT'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'maven'
sourceCompatibility=1.6
targetCompatibility=1.6
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.commons:commons-lang3:3.0.1'
compile 'commons-io:commons-io:1.3.2'
compile 'commons-codec:commons-codec:1.2'
compile 'log4j:log4j:1.2.17'
testCompile 'junit:junit:4.11'
}
task sourceJar(type: Jar) { from sourceSets.main.allJava }
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar { classifier "sources" }
}
}
repositories {
maven {
url "../mvn-repo"
}
}
}
// Prevent Eclipse "Gradle -> Refresh All" to execute cleanEclipseJdt,
// because it would delete our version of the org.eclipse.jdt.ui.prefs file.
cleanEclipse.dependsOn = cleanEclipse.taskDependencies.values - cleanEclipseJdt
configurations { xjc }
dependencies {
xjc group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2.4-1'
}
project.ext.schemaTargetDir = new File("$projectDir/src/main/resources/scenarioo-schemas");
task createSchemaDirectory << {
println 'creating schema directory: ' + schemaTargetDir
schemaTargetDir.mkdirs()
if (schemaTargetDir.isDirectory()) {
println 'schemas directory created properly.'
}
else {
println 'ERROR: creating schema directory failed.'
throw new MissingResourceException("Schema directory was not present and could not be created")
}
}
task removeSchemaDirectory(type: Delete) {
delete schemaTargetDir
}
task schemagen(dependsOn: 'createSchemaDirectory') << {
ant.taskdef(name: 'schemagen', classname: 'com.sun.tools.jxc.SchemaGenTask', classpath: configurations.xjc.asPath)
ant.schemagen(
srcdir: new File('src/main/java/org/scenarioo/model/docu/entities'),
destdir: schemaTargetDir,
classpath: configurations.xjc.asPath
) { schema (namespace: '', file: 'scenarioo-api.xsd' ) }
}
clean.dependsOn removeSchemaDirectory
compileJava.dependsOn schemagen
task wrapper(type: Wrapper) {
}