Skip to content

Commit bdb175d

Browse files
authored
Update build (#8)
* Update build * Simplify a bit
1 parent f408a15 commit bdb175d

23 files changed

Lines changed: 342 additions & 336 deletions

File tree

.github/workflows/android.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/feature.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build libraries + example client
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
- name: Build with Gradle
24+
run: ./gradlew build --info --stacktrace

.github/workflows/master.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Master
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: set up JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
- name: Build with Gradle
24+
run: ./gradlew build --info --stacktrace

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ Desktop.ini
119119
*~
120120
.merge_file*
121121
/.gradle/
122+
build

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/build.gradle

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
apply plugin: 'com.android.application'
21

32
android {
4-
compileSdkVersion 33
53
defaultConfig {
64
applicationId "com.skjolberg.mifare.desfiretool"
7-
minSdkVersion 19
8-
targetSdkVersion 33
95
versionCode 1
106
versionName "1.0"
117
}
12-
buildTypes {
13-
release {
14-
minifyEnabled false
15-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
16-
}
17-
}
18-
lintOptions {
19-
abortOnError false
20-
}
21-
22-
23-
compileOptions {
24-
// Sets Java compatibility to Java 8
25-
sourceCompatibility JavaVersion.VERSION_1_8
26-
targetCompatibility JavaVersion.VERSION_1_8
27-
}
8+
namespace "com.skjolberg.mifare.desfiretool"
289
}
2910

3011
dependencies {
@@ -35,3 +16,4 @@ dependencies {
3516
testImplementation project(":test")
3617
androidTestImplementation project(":test")
3718
}
19+

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.skjolberg.mifare.desfiretool"
3-
>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
42

53
<uses-permission android:name="android.permission.NFC" />
64
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -28,4 +26,4 @@
2826

2927
</application>
3028

31-
</manifest>
29+
</manifest>

app/src/main/java/com/skjolberg/mifare/desfiretool/MainActivity.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -707,26 +707,23 @@ public boolean onPrepareOptionsMenu(Menu menu) {
707707

708708
@Override
709709
public boolean onOptionsItemSelected(MenuItem item) {
710-
switch (item.getItemId()) {
711-
712-
case R.id.action_settings: {
713-
showKeysFragment();
714-
return true;
715-
}
716710

717-
case R.id.action_add: {
718-
addKey();
719-
return true;
720-
}
711+
if(item.getItemId() == R.id.action_settings) {
712+
showKeysFragment();
713+
return true;
714+
}
721715

722-
case R.id.action_save : {
723-
saveFileData();
724-
return true;
725-
}
726-
727-
default:
728-
return super.onOptionsItemSelected(item);
729-
}
716+
if(item.getItemId() == R.id.action_add) {
717+
addKey();
718+
return true;
719+
}
720+
721+
if(item.getItemId() == R.id.action_save) {
722+
saveFileData();
723+
return true;
724+
}
725+
726+
return super.onOptionsItemSelected(item);
730727
}
731728

732729
private void addKey() {

build.gradle

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66

77
repositories repos
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.4.1'
9+
classpath 'com.android.tools.build:gradle:8.13.1'
1010
}
1111
}
1212

@@ -18,15 +18,68 @@ ext {
1818
androidxTestUiAutomatorVersion = '2.2.0'
1919
androidxTestExtJunitVersion = '1.1.4'
2020
mockitoVersion = '4.9.0'
21-
byteBuddyVersion = '1.14.5'
21+
byteBuddyVersion = '1.18.1'
2222

2323
}
2424

25-
allprojects {
26-
repositories {
27-
google()
28-
jcenter()
25+
def buildProjects() {
26+
subprojects.findAll { new File(it.projectDir, 'build.gradle').file }
27+
}
28+
29+
def androidApplicationProjects() {
30+
subprojects.findAll { it.name.endsWith("app")}
31+
}
32+
33+
def androidLibraryProjects() {
34+
buildProjects().findAll { !androidApplicationProjects().contains(it)}
35+
}
36+
37+
configure(androidLibraryProjects()) {
38+
apply plugin: 'com.android.library'
39+
}
40+
41+
configure(androidApplicationProjects()) {
42+
apply plugin: 'com.android.application'
43+
}
44+
45+
46+
configure(buildProjects()) {
47+
repositories repos
48+
49+
android {
50+
51+
compileSdkVersion 33
52+
53+
defaultConfig {
54+
minSdkVersion 19
55+
targetSdkVersion 33
56+
}
57+
58+
testOptions {
59+
unitTests {
60+
returnDefaultValues = true
61+
}
62+
}
63+
64+
buildTypes {
65+
release {
66+
minifyEnabled false
67+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
68+
}
69+
}
70+
71+
72+
compileOptions {
73+
sourceCompatibility JavaVersion.VERSION_11
74+
targetCompatibility JavaVersion.VERSION_11
75+
}
76+
77+
lintOptions {
78+
abortOnError false
79+
}
2980
}
81+
82+
3083
}
3184

3285
task clean(type: Delete) {

gradle/wrapper/gradle-wrapper.jar

-15.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)