-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (99 loc) · 2.7 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
buildscript {
repositories {
// def _localRepoDir = System.getenv('CG_LOCAL_REPO') ?: 'D:/CG-maven-repo'
// def localRepoDir = System.getProperty('localRepoDir', _localRepoDir)
// maven { url uri(localRepoDir) }
mavenLocal()
mavenCentral()
}
dependencies { classpath 'ee.mdd:ee-mdd-gradle:1.0-SNAPSHOT' }
}
def _scripts = System.getenv('CG_CM_SCRIPTS_HOME') ?: 'D:/CG/src/cg-cm/cg-cm-scripts'
ext.scripts = project.hasProperty('superpom') ? project.superpom : "$_scripts/gradlebuild"
logger.info "Calculated 'superpom' location: $scripts"
File f = null
try {
f = file("$scripts/repos.gradle")
} catch (e) {}
apply plugin: 'ee.mdd'
allprojects {
group = 'ee.mdd_example'
version = '1.0-SNAPSHOT'
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
sourceCompatibility = 1.7
targetCompatibility = 1.7
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
dependencies {
compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.12'
compile group: 'org.slf4j', name:'slf4j-ext', version: '1.7.12'
compile group: 'javax.enterprise', name:'cdi-api', version: '1.2'
compile group: 'javax.ejb', name: 'javax.ejb-api', version: '3.2'
compile group: 'org.eclipse.persistence', name:'javax.persistence', version: '2.1.0'
runtime group: 'ch.qos.logback', name:'logback-classic', version: '1.0.11'
testCompile 'junit:junit:4.+'
}
if(f && f.exists()) {
apply from: f.absolutePath
} else {
repositories {
mavenLocal()
mavenCentral()
}
}
jar {
manifest {
attributes 'Implementation-Title': 'Example for - Model Driven Development - DSL and Generator for several languages', 'Implementation-Version': version
}
task cleanAll << { task ->
[
'bin',
'target',
'build',
'dist',
'temp',
'.idea',
'dist.zip'
].each { name ->
def file = new File("$task.project.name/$name")
if(file.exists()) if(file.isDirectory())file.deleteDir() else file.delete()
}
}
task createFolders << { task ->
[
'src/main/java',
'src/main/resources',
'src/test/java',
'src/test/resources',
'src-gen/main/java',
'src-gen/main/resources',
'src-gen/test/java',
'src-gen/test/resources'
].each { name ->
def file = new File("$task.project.name/$name")
file.mkdirs()
}
}
}
mdd {
target = './'
facet = {
java {
common()
cdi()
ejb()
jms()
jpa()
test()
ee()
cg()
ui()
sm()
}
}
}
defaultTasks 'build', 'install'
}