-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc build logic improvements #5
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
36424fb
Use version catalog
pshevche 900b6f4
Add dependabot configuration
pshevche b478c6d
Add PR validation workflows
pshevche c021b41
Extract a convention plugin for configuring adapter projects
pshevche 67a0f5f
Execute build on Actions using idiomatic configuration
pshevche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
registries: | ||
gradle-plugin-portal: | ||
type: maven-repository | ||
url: https://plugins.gradle.org/m2 | ||
username: dummy # Required by dependabot | ||
password: dummy # Required by dependabot | ||
updates: | ||
- package-ecosystem: "gradle" | ||
directory: "/" | ||
registries: | ||
- gradle-plugin-portal | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: "Validate Gradle Wrapper" | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
validation: | ||
name: "Validation" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gradle/wrapper-validation-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Verify' | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build-and-verify: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: 'Set up JDK 8' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
- name: 'Set up JDK 21' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21 | ||
- name: 'Setup Gradle' | ||
uses: gradle/gradle-build-action@v3 | ||
- name: 'Build' | ||
run: ./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} |
8 changes: 8 additions & 0 deletions
8
buildSrc/src/main/kotlin/develocity/adapters/SourceSetExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package develocity.adapters | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.SourceSetContainer | ||
import org.gradle.api.tasks.SourceSetOutput | ||
import org.gradle.kotlin.dsl.the | ||
|
||
fun Project.sourceSetOutput(name: String): SourceSetOutput = the<SourceSetContainer>().getByName(name).output |
27 changes: 27 additions & 0 deletions
27
buildSrc/src/main/kotlin/develocity/adapters/develocity.adapters-library.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import develocity.adapters.sourceSetOutput | ||
|
||
plugins { | ||
java | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
} | ||
|
||
sourceSets { | ||
create("compatibilityApi") | ||
create("enterpriseCompatibility") | ||
create("develocityCompatibility") | ||
} | ||
|
||
tasks.jar { | ||
from(sourceSetOutput("compatibilityApi")) | ||
from(sourceSetOutput("enterpriseCompatibility")) | ||
from(sourceSetOutput("develocityCompatibility")) | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
[versions] | ||
commons-math3 = "3.6.1" | ||
guava = "32.1.2-jre" | ||
junit-jupiter = "5.10.0" | ||
|
||
[libraries] | ||
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" } | ||
guava = { module = "com.google.guava:guava", version.ref = "guava" } | ||
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" } | ||
gradle-enterprise-plugin = { module = "com.gradle:gradle-enterprise-gradle-plugin", version = "3.16.2" } | ||
develocity-plugin = { module = "com.gradle:develocity-gradle-plugin", version = "3.17-rc-4" } | ||
maven-core = { module = "org.apache.maven:maven-core", version = "3.9.6" } | ||
gradle-enterprise-extension = { module = "com.gradle:gradle-enterprise-maven-extension", version = "1.20.1" } | ||
develocity-extension = { module = "com.gradle:develocity-maven-extension", version = "1.21-rc-5" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can. But I prefer that the plugin uses the same notation as its consumers (i.e.,
sourceSetOutput
extension function).