Skip to content

Commit 281c081

Browse files
committed
build: upgrade to android gradle plugin 8.3.1 and add junit 5
1 parent 186fb7f commit 281c081

File tree

11 files changed

+55
-37
lines changed

11 files changed

+55
-37
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ google-services.json
3131

3232
# Android Profiling
3333
*.hprof
34+
35+
# Mac OS
36+
.DS_Store

app/build.gradle.kts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,63 @@
11
plugins {
22
id("com.android.application")
33
id("org.jetbrains.kotlin.android")
4+
id("de.mannodermaus.android-junit5") version "1.10.0.0"
45
}
56

67
android {
78
namespace = "woowacourse.shopping"
8-
compileSdk = 33
9+
compileSdk = 34
910

1011
defaultConfig {
1112
applicationId = "woowacourse.shopping"
1213
minSdk = 26
13-
targetSdk = 33
14+
targetSdk = 34
1415
versionCode = 1
1516
versionName = "1.0"
1617

1718
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19+
testInstrumentationRunnerArguments["runnerBuilder"] = "de.mannodermaus.junit5.AndroidJUnit5Builder"
1820
}
1921

2022
buildTypes {
21-
getByName("release") {
23+
release {
2224
isMinifyEnabled = false
2325
proguardFiles(
2426
getDefaultProguardFile("proguard-android-optimize.txt"),
25-
"proguard-rules.pro"
27+
"proguard-rules.pro",
2628
)
2729
}
2830
}
2931
compileOptions {
30-
sourceCompatibility = JavaVersion.VERSION_11
31-
targetCompatibility = JavaVersion.VERSION_11
32+
sourceCompatibility = JavaVersion.VERSION_17
33+
targetCompatibility = JavaVersion.VERSION_17
3234
}
3335
kotlinOptions {
34-
jvmTarget = "11"
36+
jvmTarget = "17"
37+
}
38+
packaging {
39+
resources {
40+
excludes += "META-INF/**"
41+
excludes += "win32-x86*/**"
42+
}
3543
}
3644
}
3745

3846
dependencies {
39-
implementation("androidx.core:core-ktx:1.9.0")
40-
implementation("androidx.appcompat:appcompat:1.6.0")
41-
implementation("com.google.android.material:material:1.7.0")
47+
implementation("androidx.core:core-ktx:1.10.1")
48+
implementation("androidx.appcompat:appcompat:1.6.1")
49+
implementation("com.google.android.material:material:1.10.0")
50+
implementation("androidx.activity:activity-ktx:1.8.2")
4251
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
43-
testImplementation("junit:junit:4.13.2")
52+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
53+
testImplementation("org.assertj:assertj-core:3.25.3")
54+
testImplementation("io.kotest:kotest-runner-junit5:5.8.0")
4455
androidTestImplementation("androidx.test.ext:junit:1.1.5")
4556
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
57+
androidTestImplementation("androidx.test:runner:1.4.0")
58+
androidTestImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
59+
androidTestImplementation("org.assertj:assertj-core:3.25.3")
60+
androidTestImplementation("io.kotest:kotest-runner-junit5:5.8.0")
61+
androidTestImplementation("de.mannodermaus.junit5:android-test-core:1.3.0")
62+
androidTestRuntimeOnly("de.mannodermaus.junit5:android-test-runner:1.3.0")
4663
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
android:fullBackupContent="@xml/backup_rules"
99
android:icon="@mipmap/ic_launcher"
1010
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
1112
android:supportsRtl="true"
1213
android:theme="@style/Theme.Shopping"
1314
tools:targetApi="31">

app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

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

app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml renamed to app/src/main/res/mipmap-anydpi/ic_launcher_round.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
33
<background android:drawable="@drawable/ic_launcher_background" />
44
<foreground android:drawable="@drawable/ic_launcher_foreground" />
5+
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
56
</adaptive-icon>

build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
val agpVersion = "7.4.0"
4-
id("com.android.application") version agpVersion apply false
5-
id("com.android.library") version agpVersion apply false
6-
7-
val kotlinVersion = "1.8.10"
8-
kotlin("android") version kotlinVersion apply false
9-
kotlin("jvm") version kotlinVersion apply false
10-
id("org.jlleitschuh.gradle.ktlint") version "10.3.0" apply false
3+
id("com.android.application") version "8.3.1" apply false
4+
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
5+
id("org.jlleitschuh.gradle.ktlint") version "12.1.0" apply false
116
}
127

138
allprojects {

gradle/wrapper/gradle-wrapper.jar

2.1 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
205210

206211
set -- \
207212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

0 commit comments

Comments
 (0)