-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
143 lines (115 loc) · 3.16 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
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'java'
id 'org.jastadd' version '1.13.3'
}
defaultTasks 'jar'
if (!file('extendj/jastadd_modules').exists()) {
throw new GradleException('ExtendJ seems to be missing. Please run "git submodule init", then "git submodule update".')
}
jastadd {
configureModuleBuild()
modules {
include("extendj/jastadd_modules") // Include core ExtendJ modules.
module "intraj", {
imports "java8 frontend" // ExtendJ dependency for intraj module.
jastadd {
basedir "src/jastadd/"
include "**/*.ast"
include "**/*.jadd"
include "**/*.jrag"
}
}
}
// Target module to build:
module = 'intraj'
jastaddOptions = [ "--rewrite=cnta",
"--safeLazy",
"--visitCheck=false",
"--optimize-imports"]
astPackage = 'org.extendj.ast'
parser.name = 'JavaParser'
scanner.name = 'OriginalScanner'
}
sourceSets.main {
java {
srcDir 'extendj/src/frontend-main'
srcDir 'src/java'
}
resources {
srcDir 'src/java/magpiebridge/resources'
srcDir 'extendj/src/res'
srcDir jastadd.buildInfoDir
}
repositories {
mavenLocal()
flatDir { dirs "tools" }
}
dependencies {
jastadd2 name: "jastadd2"
}
}
dependencies{
testImplementation 'junit:junit:4.12'
implementation 'junit:junit:4.12'
implementation files('tools/magpiebridge-0.1.6-SNAPSHOT-jar-with-dependencies.jar')
implementation 'com.sun.net.httpserver:http:20070405'
implementation group: 'org.freemarker', name: 'freemarker', version: '2.3.29'
}
sourceSets.test{
java{
srcDir 'src/java/test/'
}
}
test {
useJUnit()
dependsOn 'cleanTest'
}
// task intraj(type: Jar) {
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } {
// exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
// }
// from sourceSets.main.output
// manifest {
// attributes 'Main-Class': 'org.extendj.IntraJ'
// }
// baseName = 'intraj'
// destinationDir = projectDir
// }
// artifacts {
// archives intraj
// }
jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes 'Main-Class': 'org.extendj.IntraJ'
}
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
baseName = 'intraj'
}
jar.destinationDirectory = projectDir
// Java -source and -target version.
sourceCompatibility = targetCompatibility = '1.8'
task sourceZip(type: Zip) {
description 'Builds a Zip file with the entire repisotory (including the ExtendJ submodule).'
destinationDirectory = projectDir
archiveFileName = "intraj-src.zip"
from (projectDir) {
exclude '**/.git'
exclude '**/.gitignore'
exclude '**/.gitattributes'
exclude '**/.gitmodules'
exclude 'build'
exclude 'bin'
exclude '.gradle'
exclude '.classpath'
exclude '.settings'
exclude '.project'
exclude '*.jar'
exclude '*.zip'
exclude '**/*.swp'
}
into 'intraj'
}