-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
98 lines (77 loc) · 2.47 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.json:json:20160212'
}
}
plugins {
id 'groovy'
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
dependencies {
implementation fileTree(dir: "${rootProject.projectDir}/lib", includes: ['*.jar'])
}
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.9'
implementation 'org.codehaus.groovy:groovy-xml:3.0.9'
}
task updateFromANAF {
doFirst {
//Download libraries
def versionDictionary = [:]
def configFile = new File('api/config/versiuniCurente.txt')
// old versions xml url -> http://static.anaf.ro/static/10/Anaf/update1/versiuni.xml -> integrator version = 1.3.15.3.3
// new versions xml url -> https://static.anaf.ro/static/10/Anaf/update5/versiuni.xml -> integrator version = 1.4.18.3.3
def versiuni = new XmlSlurper().parse('https://static.anaf.ro/static/10/Anaf/update5/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())
})
//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')
})
def packages = new File("api/src/main/resources/packages.txt")
configFile.write "Declaratie;VersiuneJ;VersiuneP\n"
versionDictionary.each { key, value ->
configFile << "${key};${value.versiuneJ};${value.versiuneJ}\n"
packages << "${key.toString().toLowerCase()}\n"
}
}
}