Skip to content

Commit

Permalink
android: move test logs to main outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
darakeon committed Dec 3, 2023
1 parent 637517b commit cd5f128
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ jobs:
path: android
command: gradle-with-metadata :Lib:testDebugUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/Lib/log
destination: log/lib
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand All @@ -580,8 +580,8 @@ jobs:
path: android
command: gradle-with-metadata :Lib:testReleaseUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/Lib/log
destination: log/lib
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand All @@ -604,8 +604,8 @@ jobs:
path: android
command: gradle-with-metadata :App:testDebugUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/App/log
destination: log/app
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand All @@ -628,8 +628,8 @@ jobs:
path: android
command: gradle-with-metadata :App:testReleaseUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/App/log
destination: log/app
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand Down
4 changes: 2 additions & 2 deletions .circleci/pieces/20-test-android-lib-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path: android
command: gradle-with-metadata :Lib:testDebugUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/Lib/log
destination: log/lib
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand Down
4 changes: 2 additions & 2 deletions .circleci/pieces/21-test-android-lib-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path: android
command: gradle-with-metadata :Lib:testReleaseUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/Lib/log
destination: log/lib
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand Down
4 changes: 2 additions & 2 deletions .circleci/pieces/22-test-android-app-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path: android
command: gradle-with-metadata :App:testDebugUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/App/log
destination: log/app
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand Down
4 changes: 2 additions & 2 deletions .circleci/pieces/23-test-android-app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path: android
command: gradle-with-metadata :App:testReleaseUnitTest -x androidDependencies -x build -x packageRelease -x packageDebug
- store_artifacts:
path: android/App/log
destination: log/app
path: outputs/logs/android
destination: logs
- store_artifacts:
path: android/gradle/verification-metadata.xml
destination: verification-metadata.xml
Expand Down
6 changes: 1 addition & 5 deletions android/Lib/src/main/kotlin/com/darakeon/dfm/lib/Log.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object Log {

var record = text.toString()

val path = Paths.get("log", "${BuildConfig.BUILD_TYPE}_${start}.log")
val path = Paths.get("..", "..", "outputs", "logs", "android", "${BuildConfig.BUILD_TYPE}_${start}.log")

if (Files.exists(path)) {
val bytes = Files.readAllBytes(path)
Expand All @@ -51,10 +51,6 @@ object Log {
@RequiresApi(Build.VERSION_CODES.O)
get() {
if (path == "") {
val dir = Paths.get("log")
if (!Files.exists(dir))
Files.createDirectory(dir)

path = now("yyyyMMdd_HHmmss_SSS")
}
return path
Expand Down
1 change: 1 addition & 0 deletions outputs/logs/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log

0 comments on commit cd5f128

Please sign in to comment.