Skip to content

Commit

Permalink
add baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
polstianka committed Sep 9, 2024
1 parent d19176d commit b4875ac
Show file tree
Hide file tree
Showing 313 changed files with 56,948 additions and 69,830 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
distribution: 'temurin'
java-version: 20.0.2+9

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Decode signing certificate into a file
env:
CERTIFICATE_BASE64: ${{ secrets.ANDROID_DIST_SIGNING_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/instance/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
/release
/benchmarkRelease
/benchmarkRelease
/src/release
1 change: 1 addition & 0 deletions apps/wallet/instance/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.tonapps.tonkeeper.ui.screen.start
import android.os.Bundle
import android.view.View
import android.widget.Button
import com.tonapps.tonkeeper.dialog.ImportWalletDialog
import com.tonapps.tonkeeper.ui.screen.add.imprt.ImportWalletScreen
import com.tonapps.tonkeeper.ui.screen.init.InitArgs
import com.tonapps.tonkeeper.ui.screen.init.InitScreen
Expand Down
51 changes: 36 additions & 15 deletions apps/wallet/instance/main/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.application")
Expand All @@ -14,6 +12,8 @@ plugins {
id("com.google.firebase.firebase-perf")
}

val isCI = project.hasProperty("android.injected.signing.store.file")

android {
namespace = Build.namespacePrefix("TonKeeper")
compileSdk = Build.compileSdkVersion
Expand All @@ -24,17 +24,9 @@ android {
targetSdk = 34
versionCode = 600

// val currentDate = SimpleDateFormat("dd-MMM-yyyy", Locale.US).format(Date()).lowercase()

versionName = "X" // $versionCode ($currentDate)
versionName = "X"

ndk {
abiFilters.add("arm64-v8a")
abiFilters.add("armeabi-v7a")
abiFilters.add("armeabi")
abiFilters.add("x86")
abiFilters.add("x86_64")
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
Expand All @@ -49,29 +41,58 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
/*postprocessing {
if (isCI) {
signingConfig = signingConfigs.getByName("release")
}
baselineProfile.automaticGenerationDuringBuild = true
/*
postprocessing {
isObfuscate = true
isOptimizeCode = true
isRemoveUnusedCode = true
isRemoveUnusedResources = true
}*/
}

debug {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("debug")
}
}

experimentalProperties["android.experimental.art-profile-r8-rewriting"] = true
experimentalProperties["android.experimental.r8.dex-startup-optimization"] = true

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}

kotlinOptions {
jvmTarget = "1.8"
}
}

baselineProfile {
saveInSrc = true
dexLayoutOptimization = true
}

dependencies {
implementation(project(Dependence.Wallet.app))

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:core:1.6.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0")

implementation(Dependence.AndroidX.profileinstaller)
baselineProfile(project(":baselineprofile:main"))
}
28,049 changes: 23,314 additions & 4,735 deletions apps/wallet/instance/main/src/release/generated/baselineProfiles/baseline-prof.txt

Large diffs are not rendered by default.

46 changes: 27 additions & 19 deletions baselineprofile/main/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("UnstableApiUsage")
import com.android.build.api.dsl.ManagedVirtualDevice

plugins {
Expand All @@ -6,12 +7,16 @@ plugins {
id("androidx.baselineprofile")
}

val isCI = project.hasProperty("android.injected.signing.store.file")

android {
namespace = Build.namespacePrefix("main.baselineprofile")
compileSdk = Build.compileSdkVersion

defaultConfig {
testInstrumentationRunnerArguments += mapOf("suppressErrors" to "EMULATOR")
minSdk = 28
targetSdk = Build.compileSdkVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -31,38 +36,41 @@ android {
jvmTarget = "1.8"
}

testOptions {
managedDevices {
devices {
create<ManagedVirtualDevice>("pixel6Api31") {
device = "Pixel 7"
apiLevel = 31
systemImageSource = "google_apis"
}
}
testOptions.managedDevices.devices {
create<ManagedVirtualDevice>("pixel6Api33") {
device = "Pixel 6"
apiLevel = 33
systemImageSource = "google"
}
}

targetProjectPath = ":apps:wallet:instance:main"
experimentalProperties["android.experimental.r8.dex-startup-optimization"] = true

experimentalProperties["android.experimental.self-instrumenting"] = true
experimentalProperties["android.experimental.testOptions.managedDevices.setupTimeoutMinutes"] = 20
experimentalProperties["android.experimental.androidTest.numManagedDeviceShards"] = 1
experimentalProperties["android.experimental.testOptions.managedDevices.maxConcurrentDevices"] = 1
experimentalProperties["android.experimental.testOptions.managedDevices.emulator.showKernelLogging"] = true
experimentalProperties["android.testoptions.manageddevices.emulator.gpu"] = "swiftshader_indirect"
experimentalProperties["android.testoptions.manageddevices.emulator.no-audio"] = "true"
if (isCI) {
experimentalProperties["android.testoptions.manageddevices.emulator.gpu"] = "swiftshader_indirect"
}
}

dependencies {
implementation("androidx.test.ext:junit:1.2.1")
implementation("androidx.test.espresso:espresso-core:3.6.1")
implementation("androidx.test.uiautomator:uiautomator:2.3.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.4")
implementation("androidx.benchmark:benchmark-macro-junit4:1.3.0")
}

baselineProfile {
managedDevices += "pixel6Api31"
managedDevices += "pixel6Api33"
useConnectedDevices = false
enableEmulatorDisplay = false
enableEmulatorDisplay = !isCI
}

androidComponents {
onVariants { v ->
val artifactsLoader = v.artifacts.getBuiltArtifactsLoader()
val testedApks = v.testedApks.map {
artifactsLoader.load(it)?.applicationId ?: "com.ton_keeper"
}
v.instrumentationRunnerArguments.put("targetAppId", testedApks)
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b4875ac

Please sign in to comment.