-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
134 lines (108 loc) · 4.42 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
apply plugin: 'war'
apply plugin: 'idea'
version = '1.0-SNAPSHOT'
ext.libraryVersions = [
arquillian: '1.1.1.Final',
arquillian_glassfish: '1.0.0.CR4',
bootstrap: '3.0.0',
glassfish: '4.0',
gson: '2.2.4',
hamcrest: '1.2',
javaee: '7.0',
jbossAS7: '7.1.1.Final',
jbossJavaeeSpec: '1.0.0.Final',
jquery: '1.10.2',
junit: '4.11',
postgresql: '9.2-1003-jdbc4',
shrinkwrapDesc: '2.0.0-alpha-3'
]
repositories {
mavenCentral()
mavenLocal()
mavenRepo url: 'http://repository.jboss.org/nexus/content/groups/public'
mavenRepo url: 'http://repository.jboss.org/nexus/content/repositories/deprecated'
}
configurations {
provided
jbossAS7ManagedTestRuntime { extendsFrom testRuntime, provided }
glassfishEmbeddedTestRuntime { extendsFrom testRuntime }
glassfishManagedTestRuntime { extendsFrom testRuntime }
glassfishRemoteTestRuntime { extendsFrom testRuntime }
}
sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += main.output + configurations.provided + main.compileClasspath
runtimeClasspath += main.output + configurations.provided + main.compileClasspath + main.runtimeClasspath
}
}
dependencies {
compile "javax:javaee-api:$libraryVersions.javaee"
compile "org.webjars:bootstrap:$libraryVersions.bootstrap"
compile "org.webjars:jquery:$libraryVersions.jquery"
compile "org.webjars:jquery-ui:$libraryVersions.jquery"
compile "com.google.code.gson:gson:$libraryVersions.gson"
testCompile "junit:junit:$libraryVersions.junit"
testCompile "org.hamcrest:hamcrest-core:$libraryVersions.hamcrest"
testCompile "org.jboss.arquillian.junit:arquillian-junit-container:$libraryVersions.arquillian"
testCompile "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-javaee:$libraryVersions.shrinkwrapDesc"
testCompile "org.glassfish.jersey.core:jersey-client:2.2"
testRuntime "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-impl-javaee:$libraryVersions.shrinkwrapDesc"
testRuntime "org.hsqldb:hsqldb:2.0.0"
testRuntime "org.codehaus.jackson:jackson-mapper-asl:1.9.13"
jbossAS7ManagedTestRuntime "org.jboss.as:jboss-as-arquillian-container-managed:$libraryVersions.jbossAS7"
jbossAS7ManagedTestRuntime "org.jboss.spec:jboss-javaee-6.0:$libraryVersions.jbossJavaeeSpec"
glassfishEmbeddedTestRuntime "org.jboss.arquillian.container:arquillian-glassfish-embedded-3.1:$libraryVersions.arquillian_glassfish"
glassfishEmbeddedTestRuntime "org.glassfish.main.extras:glassfish-embedded-all:$libraryVersions.glassfish"
glassfishManagedTestRuntime "org.jboss.arquillian.container:arquillian-glassfish-managed-3.1:$libraryVersions.arquillian_glassfish"
glassfishRemoteTestRuntime "org.jboss.arquillian.container:arquillian-glassfish-remote-3.1:$libraryVersions.arquillian_glassfish"
}
test {
useJUnit {
excludeCategories 'com.steeplesoft.frenchpress.test.IntegrationTests'
}
}
task jbossAS7ManagedTest(type: Test)
jbossAS7ManagedTest {
systemProperty 'arquillian.launch', "jbossas-managed-7"
}
task glassfishEmbeddedTest(type: Test) {
systemProperty 'arquillian.launch', "glassfish-embedded"
}
task glassfishManagedTest(type: Test) {
systemProperty 'arquillian.launch', "glassfish-managed"
}
task glassfishRemoteTest(type: Test) {
systemProperty 'arquillian.launch', "glassfish-remote"
}
tasks.withType(Test).matching({ t-> t.name.endsWith('Test') } as Spec).each { t ->
t.testClassesDir = project.sourceSets.test.output.classesDir
t.classpath = project.configurations.getByName(t.name + 'Runtime') +
project.sourceSets.main.output +
project.sourceSets.test.output
if (t.name.startsWith('jbossas')) {
t.classpath += files('src/test/resources-jbossas')
}
}
def getCkEditor() {
if (!file( "src/main/webapp/js/ckeditor").exists() ) {
ant.get(src: 'http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.2/ckeditor_4.2_standard.zip',
dest : "$buildDir/dependency-cache/",
usetimestamp : true,
verbose:true)
ant.unzip(src:"$buildDir/dependency-cache/ckeditor_4.2_standard.zip",
dest: "src/main/webapp/js")
}
}
task cleanExtra(type: Delete) {
delete 'src/main/webapp/js/ckeditor'
}
compileJava.doLast {
getCkEditor()
}
war.doLast {
ant.unzip(src: war.archivePath, dest: "$buildDir/exploded")
}
clean.dependsOn cleanExtra