-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
116 lines (103 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
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'jetty'
archivesBaseName = 'gwtupld'
group = 'ru.artlebedev'
version = '0.0.14'
sourceCompatibility = 1.6
targetCompatibility = 1.6
jar.enabled = true
war.enabled = false
jettyRun.daemon = true
idea {
project {
jdkName = '1.6'
ipr {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
}
}
}
}
repositories {
mavenRepo url: "http://repo1.maven.org/maven2"
mavenRepo url: "http://snapshots.repository.codehaus.org/"
}
dependencies {
compile 'com.google.gwt:gwt-servlet:2.4.0@jar'
compile 'com.google.gwt:gwt-servlet:2.4.0@jar'
compile 'com.google.gwt:gwt-user:2.4.0@jar'
compile 'com.google.gwt:gwt-dev:2.4.0@jar'
compile 'com.google.code.gson:gson:1.7.1@jar'
// compile files('lib/lib-gwt-file-0.2.jar')
compile 'commons-fileupload:commons-fileupload:1.2.1@jar'
}
dirEditor = 'editor/'
dirWar = 'build/war/'
dirGwtBuild = dirWar + dirEditor
task gwtCompile() << { task ->
created = (new File(dirGwtBuild)).mkdirs()
ant.java(classname:'com.google.gwt.dev.Compiler', failOnError: 'true', fork: 'true') {
jvmarg(value: '-Xss1024k')
jvmarg(value: '-Xms256M')
jvmarg(value: '-Xmx256M')
arg(line: '-war ' + dirGwtBuild)
arg(line: '-logLevel INFO')
// arg(line: '-style PRETTY')
arg(line: '-localWorkers 4')
// arg(line: '-treeLogger')
arg(value: 'ru.artlebedev.' + archivesBaseName + '.GwtupldDevMode')
classpath {
pathElement(location: "src/main/java")
pathElement(path: configurations.compile.asPath)
}
}
}
task devmode() << {
ant.java(classname:'com.google.gwt.dev.DevMode', failOnError: 'true', fork: 'true') {
jvmarg(value: '-Xss1024k')
jvmarg(value: '-Xms256M')
jvmarg(value: '-Xmx256M')
arg(line: '-war ' + dirWar)
arg(line: '-startupUrl ' + dirEditor + 'index.html')
arg(line: '-port 8081')
// uncomment to bind to all IPs, not just 127.0.0.1
// useful for debugging in a virtualized OS
// arg(line: '-bindAddress 0.0.0.0')
arg(value: 'ru.artlebedev.' + archivesBaseName + '.GwtupldDevMode')
classpath {
pathElement(location: "src/main/java")
pathElement(path: configurations.compile.asPath)
}
}
}
task copyIndexHtml(type: Copy) {
from('files') {
include('*.html')
include('*.js')
include('*.css')
include('*.gif')
}
into(dirGwtBuild)
}
task copyGwtXmlSources(type: Copy) {
from('src/main/java') {
include('**/*.properties')
include('**/*.xml')
include('**/*.gwt.xml')
include('**/*.png')
include('**/*.java')
}
into('build/classes/main')
}
classes.dependsOn copyGwtXmlSources
gwtCompile.dependsOn classes
//devmode.dependsOn gwtCompile
devmode.dependsOn copyIndexHtml
devmode.dependsOn jettyRun
assemble.dependsOn jar
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-5'
}