Skip to content

Commit

Permalink
feature/46 refactor 2023 (#56)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mpern authored Jul 31, 2023
1 parent 3745365 commit 06d52b9
Show file tree
Hide file tree
Showing 159 changed files with 1,046 additions and 1,948 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Gradle build
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 8
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Gradle build
Expand All @@ -82,15 +82,12 @@ jobs:
verify:
strategy:
matrix:
# https://gradle.org/releases/
GRADLE_VERSION:
- "6.9.4"
- "7.0.2"
- "7.1.1"
- "7.2"
- "7.3.3"
- "7.4.2"
- "7.5.1"
- "7.6.2"
- "8.0.2"
- "8.1.1"
- "8.2.1"
runs-on: ubuntu-latest
needs: [basic, compliance]
name: with Gradle ${{ matrix.GRADLE_VERSION }}
Expand All @@ -100,22 +97,22 @@ jobs:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Gradle build
uses: gradle/gradle-build-action@v2
env:
GRADLE_VERSION: ${{ matrix.GRADLE_VERSION }}
with:
arguments: check
arguments: check -x spotlessCheck
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ${{ matrix.GRADLE_VERSION }}-test-result
path: |
build/reports
build/test-results
*/build/reports
*/build/test-results
publish:
runs-on: ubuntu-latest
Expand All @@ -127,7 +124,7 @@ jobs:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Gradle build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
.idea
/build
/out
/bin
Expand Down
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
you any rights to use or access any SAP External Product, or provide any third
parties the right to use of access any SAP External Product, through API Calls.

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

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

Files: src/*
Files: */src/*
Copyright: 2020 SAP SE or an SAP affiliate company and commerce-gradle-plugin contributors
License: Apache-2.0
36 changes: 34 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,44 @@

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

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

## [Unreleased]

TBD
### Added

- Gradle 8 support ([#45])
- Commerce build, `HybrisAntTask`: configure additional ant properties via command
line flags ([#29]), e.g.
```bash
> ./gradlew ybuild --antProperty=build.parallel=true --antProperty=foo.bar=false
```

### Changed

- Misc. internal refactoring ([#44], [#46])

### Deprecated

- Commerce build, `removeUnusedExtensions`: `sparseBootstrap` introduced in 3.9.0
is the better way to save disk space

### Removed

- Dropped support for all Gradle versions < 7.6.2

### Fixed

- Commerce build, `removeUnusedExtensions`: do not modify default excludes ([#52])



[#29]: https://github.com/SAP/commerce-gradle-plugin/issues/29
[#45]: https://github.com/SAP/commerce-gradle-plugin/issues/45
[#52]: https://github.com/SAP/commerce-gradle-plugin/issues/52
[#46]: https://github.com/SAP/commerce-gradle-plugin/issues/46
[#44]: https://github.com/SAP/commerce-gradle-plugin/issues/44

## [3.10.0] 2023-07-17

Expand Down
1 change: 1 addition & 0 deletions build-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions build-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("mpern.commons")
id("mpern.plugin.basics")
}

dependencies {
implementation(project(":plugin-commons"))
}

gradlePlugin {

plugins {
create("hybrisPlugin") {
id = "sap.commerce.build"
implementationClass = "mpern.sap.commerce.build.HybrisPlugin"

displayName = "SAP Commerce Bootstrap & Build Plugin"
description = """Manage the whole development lifecycle of your SAP Commerce Project with Gradle"""
tags = setOf(
"sap commerce",
"sap hybris commerce",
"hybris",
"sap",
"commerce",
"bootstrap",
"build",
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package mpern.sap.commerce.build

import static mpern.sap.commerce.build.TestUtils.ensureParents
import static org.gradle.testkit.runner.TaskOutcome.*
import static org.gradle.testkit.runner.TaskOutcome.SKIPPED
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS

import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.time.Instant
import java.time.temporal.ChronoUnit

Expand Down Expand Up @@ -139,10 +139,10 @@ class BootstrapTest extends Specification {

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

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

def "boostrap sets up db drivers"() {
Expand Down
Loading

0 comments on commit 06d52b9

Please sign in to comment.