forked from OPEN-ENT-NG/rbs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
98 lines (84 loc) · 2.64 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
apply from: "gradle/vertx.gradle"
apply plugin: 'scala'
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
dependencies {
compile "org.entcore:common:$entCoreVersion"
compile 'org.mnode.ical4j:ical4j:2.0.2'
testCompile "org.entcore:tests:$entCoreVersion"
testCompile 'net.minidev:json-smart:1.1.1'
testCompile 'io.gatling.highcharts:gatling-charts-highcharts:2.0.3'
}
javadoc {
options.encoding = 'UTF-8'
classpath = configurations.provided
classpath += configurations.compile
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
//noinspection SpellCheckingInspection
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
task deploymentJar(type: Jar) {
classifier = 'deployment'
from 'deployment'
}
artifacts {
archives testJar
archives deploymentJar
}
repositories {
maven {
url "http://maven.web-education.net/nexus/content/groups/public"
}
}
def configurePom(def pom) {
pom.project {
description 'RBS'
inceptionYear '2014'
packaging 'zip'
url 'http://code.web-education.net/ong/rbs'
developers {
developer {
id 'cverdier'
name 'Cyril Verdier'
email 'cyril.verdier@atos.net'
}
}
scm {
url 'git@code.web-education.net:ong/rbs.git'
}
properties {
setProperty('project.build.sourceEncoding', 'UTF8')
}
}
}
def generateMissingI18n() {
JsonSlurper jsonSlurper = new JsonSlurper()
File rootDir = new File(".")
rootDir.eachFileRecurse {
if (it.isDirectory() && ("i18n".equals(it.getName()) || ("timeline".equals(it.getName()) && it.getParent().endsWith("i18n")))) {
Map i18n = [:]
it.eachFileMatch(~/.+.json/) { file ->
def t = file.text
i18n.put(file.getName(), (Map) jsonSlurper.parseText((t != null && !t.empty) ? t : "{}"))
}
Map fr = i18n.remove("fr.json")
new File(it, "fr.json").withWriter { it << JsonOutput.prettyPrint(JsonOutput.toJson(fr.sort())) }
i18n.each { key, lang ->
Map out = fr.findAll({ true })
out.putAll(lang)
new File(it, key).withWriter { it << JsonOutput.prettyPrint(JsonOutput.toJson(out.sort())) }
}
}
}
}
task generateI18n(description: 'Generate missing keys in i18n files') << {
generateMissingI18n()
}