-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
144 lines (117 loc) · 2.92 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
plugins {
id 'java'
id 'org.jastadd' version '1.12.0'
}
group 'de.wwu.muli'
version '2.0.0-SNAPSHOT'
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 'jastadd_modules' // Load module specifications from this file.
modules {
include("extendj/jastadd_modules") // Includes the core ExtendJ modules.
module "muli-lang frontend", {
moduleName "Muli Lang (based on Java SE 8)"
moduleVariant "frontend"
imports "java8 frontend" // This module depends on "java8 frontend" from ExtendJ.
java {
basedir "src/java/"
include "**/*.java"
}
jastadd {
basedir "src/frontend/"
include "**/*.ast"
include "**/*.jadd"
include "**/*.jrag"
}
scanner {
basedir "src/scanner/"
include "**/*.flex"
}
parser {
basedir "src/parser/"
include "**/*.parser"
}
}
module("muli-lang backend") {
moduleName "Muli Lang Backend (based on Java SE 8)"
moduleVariant "backend"
imports "muli-lang frontend"
imports "java8 backend"
jastadd {
basedir "src/backend"
include "**/*.jadd"
include "**/*.jrag"
}
}
}
// Target module to build:
module = 'muli-lang backend'
astPackage = 'org.extendj.ast'
genDir = 'src/gen/java'
buildInfoDir = 'src/gen-res'
parser.name = 'JavaParser'
parser.genDir = 'src/gen/java/org/extendj/parser'
scanner.name = 'OriginalScanner'
scanner.genDir = 'src/gen/java/org/extendj/scanner'
}
sourceSets.main {
java {
srcDir 'extendj/src/frontend-main'
srcDir 'extendj/src/backend-main'
// exclude 'org/extendj/PrettyPrintTask.java' // Avoid dependency on Apache Ant.
// exclude 'org/extendj/JastAddJTask.java' // Avoid dependency on Apache Ant.
}
resources {
srcDir 'extendj/src/res'
srcDir jastadd.buildInfoDir
}
}
//jar.manifest.attributes 'Main-Class': 'de.wwu.muli.FrontendMain'
jar.manifest.attributes 'Main-Class': 'de.wwu.muli.BackendMain'
jar.destinationDir = projectDir
// Java -source and -target version.
sourceCompatibility = targetCompatibility = '1.8'
task sourceZip(type: Zip) {
description 'Builds a Zip file with the entire repository (including the ExtendJ submodule).'
destinationDir = projectDir
archiveName = "muli-lang.zip"
from (projectDir) {
exclude '**/.git'
exclude '**/.gitignore'
exclude '**/.gitattributes'
exclude '**/.gitmodules'
exclude '**/.idea'
exclude 'build'
exclude 'bin'
exclude '.gradle'
exclude '.classpath'
exclude '.settings'
exclude '.project'
exclude 'src/gen'
exclude 'src/gen-res'
exclude '*.jar'
exclude '*.zip'
exclude '**/*.swp'
}
into 'muli-lang'
}
repositories{
mavenLocal()
}
configurations {
mulicp
}
dependencies {
mulicp 'de.wwu.muli:muli-classpath:2.0.0-SNAPSHOT'
}
jar {
into("/" ) {
from(configurations.mulicp) {
rename { "mulicp.jar" }
}
}
}