-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·116 lines (102 loc) · 4 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
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'version-catalog'
id 'maven-publish'
}
def isBranch = project.hasProperty('branch')
def isMainBranch = isBranch && (project.getProperty('branch') == 'master' || project.getProperty('branch') == 'main')
def isRelease = project.findProperty('release') == 'true'
ext {
versionSuffix = (isBranch && !isMainBranch && !isRelease ? ('-' + project.getProperty('branch')) : '') + (!isRelease ? '-SNAPSHOT' : '')
}
group = 'de.interactive_instruments'
version = '6.2.0' + versionSuffix
sourceSets {
annotations {
java {
srcDir 'src/annotations/java'
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
registerFeature('annotations') {
usingSourceSet(sourceSets.annotations)
}
}
dependencies {
implementation pluginLibs.bundles.all
}
gradlePlugin {
plugins {
layerPlugin {
id = 'de.interactive_instruments.xtraplatform-layer'
implementationClass = 'de.interactive_instruments.xtraplatform.LayerPlugin'
}
applicationPlugin {
id = 'de.interactive_instruments.xtraplatform-application'
implementationClass = 'de.interactive_instruments.xtraplatform.ApplicationPlugin'
}
modulePlugin {
id = 'de.interactive_instruments.xtraplatform-module'
implementationClass = 'de.interactive_instruments.xtraplatform.ModulePlugin'
}
docPlugin {
id = 'de.interactive_instruments.xtraplatform-doc'
implementationClass = 'de.interactive_instruments.xtraplatform.docs.DocPlugin'
}
compositePlugin {
id = 'de.interactive_instruments.xtraplatform-composite'
implementationClass = 'de.interactive_instruments.xtraplatform.CompositePlugin'
}
settingsPlugin {
id = 'de.interactive_instruments.xtraplatform-settings'
implementationClass = 'de.interactive_instruments.xtraplatform.SettingsPlugin'
}
}
}
def libz = rootProject.extensions
.getByType(VersionCatalogsExtension).named("libs")
catalog {
versionCatalog {
libz.getVersionAliases().each {
version(it, "${libz.findVersion(it).get().displayName}")
}
libz.getPluginAliases().each {
plugin(it, "${libz.findPlugin(it).get().get().pluginId}").versionRef("${it}")
}
libz.getLibraryAliases().each {
def versionAliases = libz.getVersionAliases().sort {a, b -> b.length() <=> a.length()}
def versionRef = versionAliases.find {alias -> it == alias } ?: versionAliases.find {alias -> it.startsWith(alias) }
library(it, "${libz.findLibrary(it).get().get().group}", "${libz.findLibrary(it).get().get().name}").versionRef(versionRef)
}
libz.getBundleAliases().each {
def libAliases = libz.getLibraryAliases().sort {a, b -> b.length() <=> a.length()}
def libRefs = libz.findBundle(it).get().get().collect {dep ->
def name = dep.name.replaceAll("-", ".")
libAliases.find {alias -> name == alias } ?: libAliases.find {alias -> name.startsWith(alias) } ?: libAliases.find {alias -> dep.group.endsWith(alias) } ?: libAliases.find {alias -> alias.endsWith(name) }
}
bundle(it, libRefs)
}
}
}
publishing {
repositories {
maven {
def releasesRepoUrl = "https://dl.interactive-instruments.de/repository/maven-releases/"
def snapshotsRepoUrl = "https://dl.interactive-instruments.de/repository/maven-snapshots/"
url version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username project.findProperty('deployUser') ?: ''
password project.findProperty('deployPassword') ?: ''
}
}
}
publications {
catalog(MavenPublication) {
artifactId = 'xtraplatform-catalog'
from components.versionCatalog
}
}
}