forked from bndtools/bnd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
93 lines (83 loc) · 2.13 KB
/
settings.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
/*
* Master Gradle initialization script
*/
import aQute.bnd.osgi.Constants
pluginManagement {
plugins {
id "com.gradle.enterprise" version "3.13.4"
}
}
/* Add bnd gradle plugin as a script dependency */
buildscript {
repositories {
maven {
name = "Bnd Snapshots"
url = uri(bnd_snapshots)
}
maven {
name = "Bnd Releases"
url = uri(bnd_releases)
}
mavenCentral()
}
var bndConfiguration = configurations.create("bnd") {
/* Since the files in the repository change with each build, we need to recheck for changes */
resolutionStrategy {
cacheChangingModulesFor(30, "minutes")
cacheDynamicVersionsFor(30, "minutes")
}
}
configurations.classpath.extendsFrom(bndConfiguration)
dependencies {
bnd("biz.aQute.bnd:biz.aQute.bnd.gradle") {
version {
require bnd_version
// Prefer RC over SNAPSHOT for next branch
prefer "latest.release"
}
}
components {
all { ComponentMetadataDetails details ->
if ((details.id.group == "biz.aQute.bnd") || (details.id.group == "biz.aQute.bnd.workspace")) {
details.changing = true
}
}
}
}
/* Add bnd gradle plugin to buildscript classpath of rootProject */
var bndPlugin = files(bndConfiguration.files)
gradle.rootProject {
buildscript {
dependencies {
classpath(bndPlugin)
}
}
}
}
plugins {
id "com.gradle.enterprise"
}
if (Boolean.parseBoolean(System.getenv("CI"))) {
gradleEnterprise {
buildScan {
publishAlways()
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
}
rootProject.name = "bnd"
gradle.ext.bndWorkspaceConfigure = { workspace ->
/*
* Compute the build time stamp.
* If the git workspace is clean, the build time is the time of the head commit.
* If the git workspace is dirty, the build time is the current time.
*/
if ("git diff --no-ext-diff --quiet".execute().waitFor() == 0) {
workspace.setProperty(Constants.TSTAMP, "git show --no-patch --format=%ct000".execute().text.trim())
} else {
workspace.setProperty(Constants.TSTAMP, Long.toString(System.currentTimeMillis()))
}
}
apply plugin: "biz.aQute.bnd.workspace"
includeBuild("gradle-plugins")