Skip to content

Commit d86a36a

Browse files
committed
Bump Gradle to 8.10.2
1 parent ad65b1d commit d86a36a

File tree

29 files changed

+846
-269
lines changed

29 files changed

+846
-269
lines changed

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: Build Java Pinning
8+
9+
runs-on: ubuntu-24.04
10+
strategy:
11+
matrix:
12+
java:
13+
- 17
14+
- 21
15+
env:
16+
PRIMARY_JAVA_VERSION: 21
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Set up JDK ${{ matrix.java }}
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: ${{ matrix.java }}
25+
26+
# Caches
27+
- name: Cache Maven
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.m2/repository
31+
key: maven-${{ hashFiles('**/build.gradle') }}
32+
restore-keys: |
33+
maven-
34+
- name: Cache Gradle
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.gradle/caches
38+
key: gradle-caches-${{ hashFiles('**/build.gradle') }}
39+
restore-keys:
40+
gradle-caches
41+
- name: Cache Android SDK
42+
uses: actions/cache@v2
43+
with:
44+
path: |
45+
~/.android/sdk
46+
key: android-${{ hashFiles('build.gradle') }}
47+
restore-keys: |
48+
android-
49+
50+
# Pre-reqs
51+
- name: Install Android SDK Manager
52+
uses: android-actions/setup-android@v2
53+
- name: Install Android SDK
54+
run: |
55+
sdkmanager "platforms;android-15" "platforms;android-30"
56+
57+
# Testing
58+
- name: Gradle Check
59+
run: ./gradlew check --stacktrace
60+
61+
# Test local publish
62+
- name: Gradle publish
63+
run: ./gradlew publishToMavenLocal --stacktrace
64+
65+
# Javadoc
66+
- name: Javadoc
67+
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
68+
run: ./gradlew javadocAll --stacktrace
69+
70+
# Test Coverage Report
71+
- name: Jacoco Test Coverage
72+
run: ./gradlew java-pinning-java11:testCodeCoverageReport
73+
74+
# Coveralls
75+
- name: Report coverage stats to Coveralls
76+
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
77+
uses: coverallsapp/github-action@v2
78+
with:
79+
format: jacoco
80+
file: java-pinning-java11/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
81+
82+
# Upload build artifacts
83+
- name: Upload build artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: java-pinning-java-${{ matrix.java }}
87+
path: |
88+
java-pinning-*/build/libs/*.jar
89+
!**/*-test-fixtures.jar
90+
!**/*-tests.jar

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 show-dependency-updates
5+
6+
.PHONY: codecov
7+
codecov:
8+
$(GRADLE) java-pinning-java11:testCodeCoverageReport
9+
echo "Code coverage report available at file://$(PWD)/java-pinnging-java11/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: javadocAll
20+
javadocAll:
21+
$(GRADLE) $@
22+
echo "javadoc available at file://$(PWD)/build/javadoc/index.html"
23+
24+
.PHONY: show-dependency-updates
25+
show-dependency-updates:
26+
$(GRADLE) dependencyUpdates

build-logic/build.gradle

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

build-logic/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'javapinning-build-logic'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
id 'ru.vyarus.animalsniffer'
3+
id 'eu.geekplace.javapinning.common-conventions'
4+
}
5+
6+
dependencies {
7+
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:4.0.3_r5@signature"
8+
}
9+
animalsniffer {
10+
sourceSets = [sourceSets.main]
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ext {
2+
javaVersion = JavaVersion.VERSION_11
3+
javaMajor = javaVersion.getMajorVersion()
4+
minAndroidSdk = 15
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+
mavenCentral()
15+
google()
16+
mavenLocal()
17+
}
18+
19+
def getAndroidRuntimeJar(androidApiLevel) {
20+
def androidHome = getAndroidHome()
21+
def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
22+
if (androidJar.isFile()) {
23+
return androidJar
24+
} else {
25+
throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
26+
}
27+
}
28+
29+
def getAndroidHome() {
30+
def androidHomeEnv = System.getenv("ANDROID_HOME")
31+
if (androidHomeEnv == null) {
32+
throw new Exception("ANDROID_HOME environment variable is not set")
33+
}
34+
def androidHome = new File(androidHomeEnv)
35+
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
36+
return androidHome
37+
}

0 commit comments

Comments
 (0)