Skip to content
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

Bump Gradle and stuff #190

Merged
merged 13 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 12 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,41 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure AWS credentials
uses: actions/checkout@v4
- name: Access AWS
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Compile
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: compileTestKotlin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
run: ./gradlew build
timeout-minutes: 45
- name: Upload test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports
path: ./build/reports/tests
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./build/test-results
build-check:
runs-on: ubuntu-latest
needs: build
steps:
- run: echo "All build jobs successful."
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
needs: build-check
needs: build
if: github.event.inputs.release != null && github.event.inputs.release != 'No'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get publish token
- name: Access Maven
id: publish-token
uses: atlassian-labs/[email protected]
- name: Release
env:
atlassian_private_username: ${{ steps.publish-token.outputs.artifactoryUsername }}
atlassian_private_password: ${{ steps.publish-token.outputs.artifactoryApiKey }}
run: |
./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.release }} -Prelease.localOnly
./gradlew release -Prelease.customUsername=${{ github.actor }} -Prelease.customPassword=${{ github.token }}
./gradlew release \
-Prelease.customUsername=${{ github.actor }} \
-Prelease.customPassword=${{ github.token }} \
-Prelease.incrementer=increment${{ github.event.inputs.release }}
./gradlew publish
73 changes: 30 additions & 43 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlinVersion = "1.2.70"
val log4jVersion = "2.17.2"

plugins {
kotlin("jvm").version("1.2.70")
id("com.atlassian.performance.tools.gradle-release").version("0.10.0")
kotlin("jvm").version("1.4.32")
`java-library`
id("com.atlassian.performance.tools.gradle-release").version("0.7.1")
id("com.gradle.build-scan").version("2.4.2")
}

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.4"
languageVersion = "1.2" // the maximum, which still produces 1.1.x metadata required by 1.2.70 kotlin clients
}
}

configurations.all {
if (name.startsWith("kotlin") || name.startsWith("dokka")) {
return@all
}
resolutionStrategy {
activateDependencyLocking()
failOnVersionConflict()
eachDependency {
when (requested.module.toString()) {
"com.google.guava:guava" -> useVersion("23.6-jre")
"com.google.guava:guava" -> useVersion("25.0-jre") // conflict between infrastructure, virtual-users and jira-actions
"org.apache.httpcomponents:httpclient" -> useVersion("4.5.13")
dagguh marked this conversation as resolved.
Show resolved Hide resolved
"com.fasterxml.jackson.core:jackson-core" -> useVersion("2.9.4")
"org.slf4j:slf4j-api" -> useVersion("1.8.0-alpha2")
Expand All @@ -43,38 +46,27 @@ configurations.all {
}

dependencies {
api("com.atlassian.performance.tools:infrastructure:[4.19.0,5.0.0)")
api("com.atlassian.performance.tools:aws-resources:[1.10.1, 2.0.0)") // 1.10.1 gives Ami.Builder.amiProvider
api("com.atlassian.performance.tools:jira-actions:[2.0.0,4.0.0)")
api("com.atlassian.performance.tools:ssh:[2.4.1,3.0.0)")
api("com.atlassian.performance.tools:virtual-users:[3.3.0,4.0.0)")
api("com.atlassian.performance.tools:infrastructure:[4.19.0, 5.0.0)")
api("com.atlassian.performance.tools:aws-resources:[1.17.0, 2.0.0)") // 1.17 avoids javax:activation dependency (and its license problem)
api("com.atlassian.performance.tools:jira-actions:[2.0.0, 4.0.0)")
api("com.atlassian.performance.tools:ssh:[2.4.1, 3.0.0)")
api("com.atlassian.performance.tools:virtual-users:[3.3.0, 4.0.0)")
api("com.amazonaws:aws-java-sdk-ec2:1.11.817")

implementation("com.atlassian.performance.tools:jvm-tasks:[1.3.0, 2.0.0)") // 1.3.0 gives TaskScope and EventBus
implementation("com.atlassian.performance.tools:workspace:[2.0.0,3.0.0)")
implementation("com.atlassian.performance.tools:workspace:[2.0.0, 3.0.0)")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("org.glassfish:javax.json:1.1")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.4")
implementation("com.google.guava:guava:23.6-jre")
implementation("com.atlassian.performance.tools:concurrency:[1.2.0,2.0.0)")
log4j(
"api",
"core",
"slf4j-impl"
).forEach { implementation(it) }

testCompile("junit:junit:4.12")
testCompile("org.assertj:assertj-core:3.11.1")
testCompile("org.hamcrest:hamcrest-library:1.3")
}
implementation("com.atlassian.performance.tools:concurrency:[1.2.0, 2.0.0)")
listOf("api", "core", "slf4j-impl").forEach { implementation("org.apache.logging.log4j:log4j-$it:$log4jVersion") }

fun log4j(
vararg modules: String
): List<String> = modules.map { module ->
"org.apache.logging.log4j:log4j-$module:$log4jVersion"
testImplementation("junit:junit:4.12")
testImplementation("org.assertj:assertj-core:3.11.1")
testImplementation("org.hamcrest:hamcrest-library:1.3")
}

tasks.getByName("test", Test::class).apply {
tasks.test {
filter {
exclude("**/*IT.class")
}
Expand All @@ -87,16 +79,11 @@ val testIntegration = task<Test>("testIntegration") {
maxParallelForks = 5
}

tasks["check"].dependsOn(testIntegration)

tasks.getByName("wrapper", Wrapper::class).apply {
gradleVersion = "5.2.1"
distributionType = Wrapper.DistributionType.ALL
tasks.check {
dependsOn(testIntegration)
}

tasks.withType<Test> {
testLogging {
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
}
tasks.wrapper {
gradleVersion = "7.6.3"
distributionType = Wrapper.DistributionType.ALL
}
Loading
Loading