Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jan 27, 2024
1 parent d208e9e commit 601a240
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 139 deletions.
33 changes: 13 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,32 @@ name: Build

on:
push:
branches: [ master, develop ]
branches: [ main ]
pull_request:
branches: [ master, develop ]
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- uses: actions/setup-java@v1
- uses: actions/checkout@v4
with:
java-version: 11
- uses: gradle/wrapper-validation-action@v1
- name: Cache Gradle packages and wrapper
uses: actions/cache@v2
fetch-depth: 0
- uses: actions/setup-java@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
cache: gradle
distribution: temurin
java-version: |
11
17
- uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
run: |
./gradlew build --warning-mode=summary
run: ./gradlew build --warning-mode=summary
- name: Sonar analysis
run: |
./gradlew sonarqube -Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=itsallcode \
-Dsonar.login=$SONAR_TOKEN \
./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN \
--warning-mode=summary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.generate.finalModifiers": "explicit",
"source.fixAll": "explicit"
},
"java.saveActions.organizeImports": true,
"java.sources.organizeImports.starThreshold": 3,
"java.sources.organizeImports.staticStarThreshold": 3,
"java.configuration.updateBuildConfiguration": "automatic"
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ Import into eclipse using [buildship](https://projects.eclipse.org/projects/tool
$ ./gradlew licenseFormat
```

### Run sonar analysis

```bash
./gradlew clean sonar --info -Dsonar.token=[token]
```

### Publish to Maven Central

1. Add the following to your `~/.gradle/gradle.properties`:
Expand Down
27 changes: 24 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ plugins {
id "maven-publish"
id "jacoco"
id "com.github.hierynomus.license" version "0.15.0"
id "org.sonarqube" version "3.1.1"
id "io.codearte.nexus-staging" version "0.22.0"
id "org.sonarqube" version "4.4.1.3373"
id "io.codearte.nexus-staging" version "0.30.0"
id "com.github.ben-manes.versions" version "0.50.0"
}

repositories {
Expand Down Expand Up @@ -44,12 +45,19 @@ license {

jacocoTestReport {
reports {
xml.enabled true
xml.required = true
}
}

rootProject.tasks["sonarqube"].dependsOn(tasks["jacocoTestReport"])

sonarqube {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "itsallcode"
}
}

def getOptionalProperty(String name) {
if(project.hasProperty(name)) {
return project.property(name)
Expand Down Expand Up @@ -112,3 +120,16 @@ nexusStaging {
username = getOptionalProperty("ossrhUsername")
password = getOptionalProperty("ossrhPassword")
}

def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}

tasks.named("dependencyUpdates").configure {
gradleReleaseChannel = "current"
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 601a240

Please sign in to comment.