This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
build.gradle
152 lines (124 loc) · 5.01 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
141
142
143
144
145
146
147
148
149
150
151
import org.apache.tools.ant.filters.EscapeUnicode
plugins {
id 'com.gradle.build-scan' version '1.0'
id "com.admc.javaPropFile" version "1.0.0"
id 'de.qaware.seu.as.code.git' version '2.3.0.RC1'
}
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service';
licenseAgree = 'yes'
}
allprojects {
apply from : "${rootProject.projectDir}/dependencies.gradle"
ext {
buildPrefix = 'build'
buildRelease = false
distDir = file("${rootProject.projectDir}/${buildPrefix}/distribution")
repoDir = file("${distDir}/repo")
samplesDir = file("${distDir}/samples")
templatesDir = file("${distDir}/templates")
repoLibDir = file("${distDir}/lib")
repoBinDir = file("${distDir}/bin")
osgiDistDir = file("${rootProject.projectDir}/${buildPrefix}/osgi-distribution")
osgiDistPluginsDir = file("${osgiDistDir}/plugins")
osgiDistFeaturesDir = file("${osgiDistDir}/features")
linkedProjectRootDir = file("${rootProject.projectDir}/${buildPrefix}/linked-projects")
}
}
buildDir = file("${buildPrefix}/root")
subprojects {
apply plugin : CeylonCommonBuildProperties
buildDir = new File(file("${rootProject.projectDir}/${buildPrefix}"), it.path.replace(":", "_").substring(1))
version= cbp.'ceylon.version'
repositories {
jcenter()
mavenCentral()
}
afterEvaluate {
tasks.withType(JavaCompile) { t ->
t.options.compilerArgs ['-Xlint:-options']
t.options.encoding = 'UTF-8'
}
}
}
task dist {
group "publish"
description "Creates the Ceylon distribution"
dependsOn ':dist:publishInternal'
dependsOn ':dist:osgi:publishInternal'
}
task clean ( type : Delete ) {
delete buildDir
delete distDir
// delete embeddedRepoDir
}
task 'clean-all' {
group "ceylon cross project"
description "Cleans everything here and in linked projects"
dependsOn clean
dependsOn 'clean-sdk'
dependsOn 'clean-ide'
}
task 'clean-sdk' {
group "ceylon cross project"
description "Cleans the SDK"
dependsOn ':linked:sdk:clean'
}
task sdk {
group "ceylon cross project"
description 'Builds the SDK'
dependsOn ':linked:sdk:publishInternal'
}
task ide {
group "ceylon cross project"
description 'Builds the IDE plugins & related modules'
dependsOn ':linked:formatter:publishInternal'
dependsOn ':linked:toolConverterJava2ceylon:publishInternal'
dependsOn ':linked:ideCommon:publishInternal'
dependsOn ':linked:ideEclipse:publishInternal'
// dependsOn ':linked:ideIntellij:publishInternal'
}
task 'clean-ide' {
group "ceylon cross project"
description 'Cleans the IDE plugins & related modules'
dependsOn ':linked:formatter:clean'
dependsOn ':linked:toolConverterJava2ceylon:clean'
dependsOn ':linked:ideCommon:clean'
// dependsOn ':linked:ideEclipse:clean'
// dependsOn ':linked:ideIntellij:clean'
}
/*
//clean-sdk - calls ant clean in the ../ceylon-sdk folder
// sdk - calls ant publish ide-quick in the ../ceylon-sdk folder
//clean-ide - calls ant clean in the ../ceylon-.formatter, ../ceylon.tool.converter.java2ceylon, ../ceylon-ide-common, ../ceylon-ide-eclipse and ../ceylon-ide-intellij folders
// eclipse - calls ant publish ide-quick in the ../ceylon-.formatter, ../ceylon.tool.converter.java2ceylon, ../ceylon-ide-common and ../ceylon-ide-eclipse folders
// intellij - calls ant publish ide-quick in the ../ceylon-.formatter, ../ceylon.tool.converter.java2ceylon, ../ceylon-ide-common and ../ceylon-ide-intellij folders
*/
// TODO: Remove this task after migration. It is only here to compare outputs of Ant vs Gradle
task migrationReports {
description "TEMPORARY: Creates comparison listings in root"
ext {
makeListing = { rootDir ->
String baseDir = file(rootDir).absolutePath
fileTree(rootDir).files.collect {
it.absolutePath.replace("${baseDir}/",'')
}.sort().join("\n")
}
makeTimeStampSanitizedListing = { rootDir ->
String baseDir = file(rootDir).absolutePath
fileTree(rootDir).files.collect {
it.absolutePath.replace("${baseDir}/",'').replaceAll(~/v\d{8}-\d{4}/,'vXxxxYyZz-AaBb')
}.sort().unique().join("\n")
}
}
doLast {
mkdir buildDir
file("${buildDir}/dist-gradle.txt").text = makeListing(distDir)
file("${buildDir}/dist-ant.txt").text = makeListing('dist/dist')
file("${buildDir}/osgi-dist-gradle.txt").text = makeTimeStampSanitizedListing(osgiDistDir)
file("${buildDir}/osgi-dist-ant.txt").text = makeTimeStampSanitizedListing('dist/osgi/build/dist')
file("${buildDir}/osgi-embeddedrepo-gradle.txt").text = makeListing("${project(':dist:osgi').buildDir}/embeddedRepository/repo")
file("${buildDir}/osgi-embeddedrepo-ant.txt").text = makeListing('dist/osgi/embeddedRepository/repo')
}
mustRunAfter sdk, ide, dist, ':dist:osgi:embeddedRepository'
}