forked from sitmun/sitmun-territorial-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
73 lines (61 loc) · 2.04 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
plugins {
id 'org.springframework.boot' version '1.5.8.RELEASE'
id 'org.sonarqube' version '2.6'
id 'org.ajoberstar.grgit' version '2.2.0'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'application'
apply plugin: 'jacoco'
group = 'org.sitmun'
version = '0.1.0-SNAPSHOT'
repositories {
mavenLocal()
mavenCentral()
}
// Dependencies to other SITMUN plugins must declared all here to facilitate using them
// in different places of this script
ext {
sitmunlibs = [:]
sitmunlibs.sitmundemo = [
gitrepo : 'https://github.com/sitmun/sitmun-plugin-demo.git',
groupId : 'org.sitmun',
artifactId : 'sitmun-plugin-demo',
version : '0.1.0-SNAPSHOT'
]
}
dependencies {
sitmunlibs.each { k,v -> implementation "${v.groupId}:${v.artifactId}:${v.version}" }
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId group
artifactId 'sitmun-territorial-app'
version version
from components.java
}
}
}
sonarqube {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'sitmun'
property 'sonar.sources', 'src/main'
}
}
task install(dependsOn: 'publishToMavenLocal')
// This custom task clones the git repositories of all sitmun dependencies defined in sitmunlibs
// It requires that a PLUGIN_DIR environment variable exists and has been exported. It will
// fail with an exception if it does not find one
task cloneDependencyRepos {
doLast {
def plugindir = System.getenv('PLUGIN_DIR')
if (plugindir == null) { throw new Exception("${plugindir} is not a valid directory for the git cloning. You must define and export a PLUGIN_DIR environment variable.") }
sitmunlibs.each { k, v ->
grgit.clone(dir: "${plugindir}/${v.artifactId}", uri: "${v.gitrepo}", refToCheckout: "${v.version}")
}
}
}