Skip to content

Commit 13ba94e

Browse files
authored
SONARIAC-1963 Put in place CI for cloud-native-gradle-modules (#31)
1 parent 1694868 commit 13ba94e

4 files changed

Lines changed: 48 additions & 41 deletions

File tree

.cirrus.star

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
load("github.com/SonarSource/cirrus-modules@v3", "load_features")
2+
load(
3+
"github.com/SonarSource/cirrus-modules/cloud-native/helper.star@analysis/master",
4+
"merge_dict"
5+
)
6+
load(
7+
"github.com/SonarSource/cirrus-modules/cloud-native/env.star@analysis/master",
8+
"cirrus_env",
9+
"gradle_base_env",
10+
"gradle_develocity_env",
11+
)
12+
load(
13+
"github.com/SonarSource/cirrus-modules/cloud-native/cache.star@analysis/master",
14+
"gradle_cache",
15+
"gradle_wrapper_cache",
16+
"cleanup_gradle_script",
17+
"cleanup_gradle_wrapper_cache_script",
18+
)
19+
load(
20+
"github.com/SonarSource/cirrus-modules/cloud-native/platform.star@analysis/master",
21+
"base_image_container_builder"
22+
)
223

324

425
def main(ctx):
5-
return load_features(ctx, only_if=dict())
26+
conf = {}
27+
merge_dict(conf, load_features(ctx))
28+
merge_dict(conf, build_task())
29+
return conf
30+
31+
32+
def build_task():
33+
return {
34+
"build_task": {
35+
"env": gradle_base_env() | gradle_develocity_env() | {
36+
"CIRRUS_CLONE_DEPTH": 10,
37+
},
38+
"eks_container": base_image_container_builder(cpu=1, memory="4G"),
39+
"gradle_cache": gradle_cache(),
40+
"gradle_wrapper_cache": gradle_wrapper_cache(),
41+
"build_script": [
42+
"./gradlew build"
43+
],
44+
"cleanup_script": cleanup_gradle_script(),
45+
"cleanup_wrapper_script": cleanup_gradle_wrapper_cache_script(),
46+
}
47+
}

.cirrus.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

gradle-modules/src/main/kotlin/org.sonarsource.cloud-native.sonar-plugin.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ val cleanupTask = tasks.register<Delete>("cleanupOldVersion") {
2727

2828
// those variables need to be calculated in the configuration phase to enable Configuration cache
2929
// https://docs.gradle.org/8.12.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
30-
var projectName = "${project.name}"
30+
var projectName = project.name
3131
var projectVersion = "${project.version}"
3232
delete(
3333
fileTree(layout.buildDirectory.dir("libs")).matching {
34-
include("${projectName}-*.jar")
35-
exclude("${projectName}-${projectVersion}-*.jar")
34+
include("$projectName-*.jar")
35+
exclude("$projectName-$projectVersion-*.jar")
3636
}
3737
)
3838
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
org.gradle.caching=true
2+
3+
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m

0 commit comments

Comments
 (0)