Skip to content

Commit 32caa88

Browse files
authored
Merge pull request #146 from Flowdalic/gradle-bump
Bump Gradle to 8.10.2
2 parents 020e232 + 4433a70 commit 32caa88

File tree

64 files changed

+1194
-531
lines changed

Some content is hidden

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

64 files changed

+1194
-531
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
name: CI
22

3-
env:
4-
GRADLE_VERSION: 6.7.1
5-
63
on: [push, pull_request]
74

85
jobs:
96
build:
107
name: Build MiniDNS
118

12-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1310
strategy:
1411
matrix:
1512
java:
16-
- 11
17-
- 15
13+
- 17
14+
- 21
1815
env:
19-
PRIMARY_JAVA_VERSION: 11
16+
PRIMARY_JAVA_VERSION: 21
2017

2118
steps:
2219
- name: Checkout
@@ -57,11 +54,6 @@ jobs:
5754
android-
5855
5956
# Pre-reqs
60-
- name: Grab gradle wrapper
61-
run: |
62-
wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
63-
unzip gradle-${GRADLE_VERSION}-all.zip
64-
echo "PATH_TO_GRADLE=./gradle-${GRADLE_VERSION}/bin/gradle" >> $GITHUB_ENV
6557
- name: Install Android SDK Manager
6658
uses: android-actions/setup-android@v2
6759
- name: Install Android SDK
@@ -72,23 +64,28 @@ jobs:
7264
7365
# Testing
7466
- name: Gradle Check
75-
run: ${PATH_TO_GRADLE} check --stacktrace
67+
run: ./gradlew check --stacktrace
7668

7769
# Test local publish
7870
- name: Gradle publish
79-
run: ${PATH_TO_GRADLE} publishToMavenLocal --stacktrace
71+
run: ./gradlew publishToMavenLocal --stacktrace
8072

8173
# Javadoc
8274
- name: Javadoc
8375
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
84-
run: ${PATH_TO_GRADLE} javadocAll --stacktrace
76+
run: ./gradlew javadocAll --stacktrace
8577

8678
# Test Coverage Report
8779
- name: Jacoco Test Coverage
80+
run: ./gradlew minidns-hla:testCodeCoverageReport
81+
82+
# Coveralls
83+
- name: Report coverage stats to Coveralls
8884
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
89-
run: ${PATH_TO_GRADLE} jacocoRootReport coveralls
90-
env:
91-
COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
85+
uses: coverallsapp/github-action@v2
86+
with:
87+
format: jacoco
88+
file: minidns-hla/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
9289

9390
# Upload build artifacts
9491
- name: Upload build artifacts

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
GRADLE ?= ./gradlew
2+
3+
.PHONY: all
4+
all: check codecov eclipse javadocAll inttest
5+
6+
.PHONY: codecov
7+
codecov:
8+
$(GRADLE) minidns-hla:testCodeCoverageReport
9+
echo "Code coverage report available at $(PWD)/minidns-hla/build/reports/jacoco/testCodeCoverageReport/html/index.html"
10+
11+
.PHONY: check
12+
check:
13+
$(GRADLE) $@
14+
15+
.PHONY: eclipse
16+
eclipse:
17+
$(GRADLE) $@
18+
19+
.PHONY: inttest
20+
inttest:
21+
$(GRADLE) $@
22+
23+
.PHONY: javadocAll
24+
javadocAll:
25+
$(GRADLE) $@
26+
echo "javadoc available at $(PWD)/build/javadoc/index.html"

build-logic/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
id 'groovy-gradle-plugin'
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}
8+
9+
dependencies {
10+
implementation "biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0"
11+
implementation "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
12+
implementation "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
13+
}

build-logic/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'minidns-build-logic'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
compileJava {
2+
options.bootstrapClasspath = files(androidBootClasspath)
3+
}
4+
javadoc {
5+
classpath += files(androidBootClasspath)
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins {
2+
id 'ru.vyarus.animalsniffer'
3+
id 'org.minidns.common-conventions'
4+
}
5+
dependencies {
6+
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:4.4.2_r4@signature"
7+
}
8+
animalsniffer {
9+
sourceSets = [sourceSets.main]
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
plugins {
2+
id 'application'
3+
}
4+
5+
application {
6+
applicationDefaultJvmArgs = ["-enableassertions"]
7+
}
8+
9+
run {
10+
// Pass all system properties down to the "application" run
11+
systemProperties System.getProperties()
12+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ext {
2+
javaVersion = JavaVersion.VERSION_11
3+
javaMajor = javaVersion.getMajorVersion()
4+
minAndroidSdk = 19
5+
6+
androidBootClasspath = getAndroidRuntimeJar(minAndroidSdk)
7+
8+
// Export the function by turning it into a closure.
9+
// https://stackoverflow.com/a/23290820/194894
10+
getAndroidRuntimeJar = this.&getAndroidRuntimeJar
11+
}
12+
13+
repositories {
14+
mavenLocal()
15+
mavenCentral()
16+
}
17+
18+
def getAndroidRuntimeJar(androidApiLevel) {
19+
def androidHome = getAndroidHome()
20+
def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
21+
if (androidJar.isFile()) {
22+
return androidJar
23+
} else {
24+
throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
25+
}
26+
}
27+
28+
def getAndroidHome() {
29+
def androidHomeEnv = System.getenv("ANDROID_HOME")
30+
if (androidHomeEnv == null) {
31+
throw new Exception("ANDROID_HOME environment variable is not set")
32+
}
33+
def androidHome = new File(androidHomeEnv)
34+
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
35+
return androidHome
36+
}

0 commit comments

Comments
 (0)