Skip to content

Commit 06d52b9

Browse files
authored
feature/46 refactor 2023 (#56)
* update versions * remove ccv1 plugin * fix spotless importorder diffplug/spotless#522 (comment) * typo * adapt to changed @input handling of Gradle 8 https://docs.gradle.org/8.0.1/userguide/validation_problems.html#incorrect_use_of_input_annotation * use variable * bump versions * kotlin script transition WIP * kotlin script and updates * use jvm-test-suite plugin * update java version * extract commonTest to test-utils subproject * update cleanGlob * minor updates * fix deprecations and other warings * cleanup code * cleanup code * refactor mpern.sap.commerce.build.util.Extension #44 * update CHANGELOG * split into subprojects * fix reuse compliance * fix GH actions * try toolchain * disalbe SAP vendor in toolchain * fix GH actions part 2 * fix paths to test results * fix backwards compat * misc improvements * update build * whups * misc code cleanup
1 parent 3745365 commit 06d52b9

File tree

159 files changed

+1046
-1948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+1046
-1948
lines changed

.github/workflows/gradle.yml

+11-14
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Java
4141
uses: actions/setup-java@v3
4242
with:
43-
java-version: 8
43+
java-version: 17
4444
distribution: 'temurin'
4545
cache: 'gradle'
4646
- name: Gradle build
@@ -63,7 +63,7 @@ jobs:
6363
- name: Set up Java
6464
uses: actions/setup-java@v3
6565
with:
66-
java-version: 8
66+
java-version: '17'
6767
distribution: 'temurin'
6868
cache: 'gradle'
6969
- name: Gradle build
@@ -82,15 +82,12 @@ jobs:
8282
verify:
8383
strategy:
8484
matrix:
85+
# https://gradle.org/releases/
8586
GRADLE_VERSION:
86-
- "6.9.4"
87-
- "7.0.2"
88-
- "7.1.1"
89-
- "7.2"
90-
- "7.3.3"
91-
- "7.4.2"
92-
- "7.5.1"
9387
- "7.6.2"
88+
- "8.0.2"
89+
- "8.1.1"
90+
- "8.2.1"
9491
runs-on: ubuntu-latest
9592
needs: [basic, compliance]
9693
name: with Gradle ${{ matrix.GRADLE_VERSION }}
@@ -100,22 +97,22 @@ jobs:
10097
- name: Setup Java JDK
10198
uses: actions/setup-java@v3
10299
with:
103-
java-version: 8
100+
java-version: 17
104101
distribution: 'temurin'
105102
cache: 'gradle'
106103
- name: Gradle build
107104
uses: gradle/gradle-build-action@v2
108105
env:
109106
GRADLE_VERSION: ${{ matrix.GRADLE_VERSION }}
110107
with:
111-
arguments: check
108+
arguments: check -x spotlessCheck
112109
- uses: actions/upload-artifact@v3
113110
if: ${{ failure() }}
114111
with:
115112
name: ${{ matrix.GRADLE_VERSION }}-test-result
116113
path: |
117-
build/reports
118-
build/test-results
114+
*/build/reports
115+
*/build/test-results
119116
120117
publish:
121118
runs-on: ubuntu-latest
@@ -127,7 +124,7 @@ jobs:
127124
- name: Setup Java JDK
128125
uses: actions/setup-java@v3
129126
with:
130-
java-version: 8
127+
java-version: 17
131128
distribution: 'temurin'
132129
cache: 'gradle'
133130
- name: Gradle build

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gradle
2+
.idea
23
/build
34
/out
45
/bin

.reuse/dep5

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
2424
you any rights to use or access any SAP External Product, or provide any third
2525
parties the right to use of access any SAP External Product, through API Calls.
2626

27-
Files: .gitignore README.md CHANGELOG.md CONTRIBUTING.md .java-version *.gradle gradle/* .github/* docs/* manualTest/*
27+
Files: gradle.properties .gitignore */.gitignore README.md CHANGELOG.md CONTRIBUTING.md .java-version */*.gradle.kts *.gradle.kts gradle/* .github/* docs/* manualTest/*
2828
Copyright: 2020 SAP SE or an SAP affiliate company and commerce-gradle-plugin contributors
2929
License: CC0-1.0
3030

3131
Files: gradlew gradlew.bat gradle/wrapper/*
3232
Copyright: Gradle Inc. 2020
3333
License: Apache-2.0
3434

35-
Files: src/*
35+
Files: */src/*
3636
Copyright: 2020 SAP SE or an SAP affiliate company and commerce-gradle-plugin contributors
3737
License: Apache-2.0

CHANGELOG.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,44 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10-
TBD
10+
### Added
11+
12+
- Gradle 8 support ([#45])
13+
- Commerce build, `HybrisAntTask`: configure additional ant properties via command
14+
line flags ([#29]), e.g.
15+
```bash
16+
> ./gradlew ybuild --antProperty=build.parallel=true --antProperty=foo.bar=false
17+
```
18+
19+
### Changed
20+
21+
- Misc. internal refactoring ([#44], [#46])
22+
23+
### Deprecated
24+
25+
- Commerce build, `removeUnusedExtensions`: `sparseBootstrap` introduced in 3.9.0
26+
is the better way to save disk space
27+
28+
### Removed
29+
30+
- Dropped support for all Gradle versions < 7.6.2
31+
32+
### Fixed
33+
34+
- Commerce build, `removeUnusedExtensions`: do not modify default excludes ([#52])
35+
36+
37+
38+
[#29]: https://github.com/SAP/commerce-gradle-plugin/issues/29
39+
[#45]: https://github.com/SAP/commerce-gradle-plugin/issues/45
40+
[#52]: https://github.com/SAP/commerce-gradle-plugin/issues/52
41+
[#46]: https://github.com/SAP/commerce-gradle-plugin/issues/46
42+
[#44]: https://github.com/SAP/commerce-gradle-plugin/issues/44
1143

1244
## [3.10.0] 2023-07-17
1345

build-plugin/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

build-plugin/build.gradle.kts

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
plugins {
2+
id("mpern.commons")
3+
id("mpern.plugin.basics")
4+
}
5+
6+
dependencies {
7+
implementation(project(":plugin-commons"))
8+
}
9+
10+
gradlePlugin {
11+
12+
plugins {
13+
create("hybrisPlugin") {
14+
id = "sap.commerce.build"
15+
implementationClass = "mpern.sap.commerce.build.HybrisPlugin"
16+
17+
displayName = "SAP Commerce Bootstrap & Build Plugin"
18+
description = """Manage the whole development lifecycle of your SAP Commerce Project with Gradle"""
19+
tags = setOf(
20+
"sap commerce",
21+
"sap hybris commerce",
22+
"hybris",
23+
"sap",
24+
"commerce",
25+
"bootstrap",
26+
"build",
27+
)
28+
}
29+
}
30+
}

src/functionalTest/groovy/mpern/sap/commerce/build/BootstrapTest.groovy build-plugin/src/functionalTest/groovy/mpern/sap/commerce/build/BootstrapTest.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package mpern.sap.commerce.build
22

33
import static mpern.sap.commerce.build.TestUtils.ensureParents
4-
import static org.gradle.testkit.runner.TaskOutcome.*
4+
import static org.gradle.testkit.runner.TaskOutcome.SKIPPED
5+
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
56

67
import java.nio.file.Files
78
import java.nio.file.Path
8-
import java.nio.file.Paths
99
import java.time.Instant
1010
import java.time.temporal.ChronoUnit
1111

@@ -139,10 +139,10 @@ class BootstrapTest extends Specification {
139139

140140
!Files.exists(dummyPlatformFile)
141141
!Files.exists(dotFile)
142-
!Files.exists(testProjectDir.resolve(Paths.get("hybris/bin/ext-accelerator")))
142+
!Files.exists(testProjectDir.resolve(Path.of("hybris/bin/ext-accelerator")))
143143

144144
buildFile.text.contains("version=$providedVersion")
145-
Files.exists(testProjectDir.resolve(Paths.get( "hybris/bin/ext-template/yaccelerator/src/dummy.java")))
145+
Files.exists(testProjectDir.resolve(Path.of( "hybris/bin/ext-template/yaccelerator/src/dummy.java")))
146146
}
147147

148148
def "boostrap sets up db drivers"() {

0 commit comments

Comments
 (0)