-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
155 lines (117 loc) · 3.6 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
152
153
154
155
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'org.json:json:20160212'
}
}
plugins {
id 'java'
id 'application'
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
compileTestJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
repositories {
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile fileTree(dir: "${project.rootDir}/lib", includes: ['*.jar'])
compile 'org.eclipse.jetty:jetty-server:9.3.8.v20160314'
compile 'org.eclipse.jetty:jetty-servlet:9.3.8.v20160314'
compile 'org.glassfish.jersey.core:jersey-server:2.22.2'
compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.2'
compile 'org.reflections:reflections:0.9.10'
compile 'org.json:json:20160212'
testCompile 'junit:junit:4.12'
}
sourceSets {
main {
java {
srcDir 'DUKIntegrator/src'
}
}
}
mainClassName = "ro.incremental.anaf.declaratii.JobQueueServer"
distTar {
compression = Compression.GZIP
}
distributions {
main {
contents {
from('config') {
into "config"
}
from('examples') {
into 'examples'
}
from('ajutor') {
into 'ajutor'
}
}
}
}
task stage {
dependsOn installDist
}
task updateFromANAF {
doFirst {
//Download an unpack sources
ant.get(src: 'http://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/src_20140505.zip', dest: 'DUKIntegrator/src.zip')
ant.unzip(src: 'DUKIntegrator/src.zip', dest: 'DUKIntegrator')
delete('DUKIntegrator/src.zip')
//Download libraries
def versionDictionary = [:]
def configFile = new File('config/versiuniCurente.txt')
def versiuni = new XmlSlurper().parse('http://static.anaf.ro/static/10/Anaf/update1/versiuni.xml')
def allUrls = []
//Itext and dependencies
versiuni.integrator.iJars.childNodes().each({
allUrls.add(it.text())
})
//Validator and dependencies
versiuni.integrator.sJars.childNodes().each({
allUrls.add(it.text())
})
//DUK and dependencies
versiuni.integrator.zJars.childNodes().each({
allUrls.add(it.text())
})
//Download and dependencies
versiuni.integrator.dJars.childNodes().each({
allUrls.add(it.text())
})
//Get declaratii URL's
versiuni.declaratii.childNodes().each({
def name = it.name()
//Flatten library XML
def library = it.children().inject([:], { acc, value ->
acc[value.name()] = value.text()
acc
})
allUrls.add(library.JURL)
allUrls.add(library.PURL)
versionDictionary[name] = library
})
//Download all url's
allUrls.each({
println it
ant.get(src: it, dest: 'lib')
})
// configFile.write versiuni.integrator.versiune "Declaratie;VersiuneJ;VersiuneP\n"
configFile.write "Declaratie;VersiuneJ;VersiuneP\n"
def packages = new File("src/main/resources/packages.txt")
versionDictionary.each { key, value ->
configFile << "${key};${value.versiuneJ};${value.versiuneJ}\n"
packages << "${key.toString().toLowerCase()}\n"
}
}
}