forked from dotCMS/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
94 lines (76 loc) · 2.67 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
configurations {
compile
antLibs
coreWeb
provided
ext.dotcmsFolder = "dotCMS"
ext.rulesEngineFolder ="dotCMS/html/js/_rulesengine"
ext.libsFolder = "dotCMS/WEB-INF/lib"
ext.felixFolder = "dotCMS/WEB-INF/felix/bundle"
ext.testLibsFolder = "libs/test"
}
//Import and apply the dependencies from the dependencies scripts
apply from: "$rootDir/dependencies.gradle"
configurations.all({
// dynamic: e.g. 'version: 2.0+'
resolutionStrategy.cacheDynamicVersionsFor 1, 'hours'
// changing: e.g. 'version 2.0.0-SNAPSHOT'
resolutionStrategy.cacheChangingModulesFor 10, 'minutes'
})
repositories {
maven { url "http://repo.dotcms.com/artifactory/libs-release" }
maven { url "http://repo.dotcms.com/artifactory/libs-snapshot-local" }
}
//Syncing the dotCMS/WEB-INF/lib folder
task webinfLibs(type: Sync) {
from configurations.compile
into configurations.libsFolder
exclude '**/dot.org.apache.felix.bundlerepository*.jar'
exclude '**/dot.org.apache.felix.fileinstall*.jar'
exclude '**/dot.org.apache.felix.gogo.*.jar'
exclude '**/junit-*.jar'
exclude '**/*.zip'
}
webinfLibs.description = 'Synchronizes the dependencies with the dotCMS/WEB-INF/lib folder'
task copyToLib {
copy {
from configurations.compile
into configurations.felixFolder
include '**/dot.org.apache.felix.bundlerepository*.jar'
include '**/dot.org.apache.felix.fileinstall*.jar'
include '**/dot.org.apache.felix.gogo.*.jar'
include '**/dot.org.apache.felix.http.bundle*.jar'
}
copy {
from configurations.compile
into configurations.testLibsFolder
include '**/junit-*.jar'
}
copy {
from configurations.compile
into configurations.dotcmsFolder
include '**/starter*.zip'
rename ( /starter(.+)\.zip/, "starter.zip" )
}
doLast {
copy {
from(zipTree(configurations.coreWeb.files.toArray()[0]))
into configurations.rulesEngineFolder
}
}
}
copyToLib.description = 'Synchronizes the dependencies with the dotCMS/WEB-INF/felix/bundle folder, copies the starter.zip and the core-web project files'
dependencies {
antLibs group: 'org.apache.ant', name: 'ant-junit', version: '1.9.3'
antLibs group: 'ant-contrib', name: 'ant-contrib', version: '1.0b3'
}
ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader
configurations.antLibs.each { File f -> antClassLoader.addURL(f.toURI().toURL()) }
//Moving dependencies
tasks.webinfLibs.execute()
tasks.copyToLib.execute()
ant.importBuild 'build.xml'
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
defaultTasks 'help', 'tasks'