Skip to content

Commit 5e71141

Browse files
Merge pull request #25 from MateusRodCosta/dev
Version 1.5.0
2 parents a882d4b + 0b05a02 commit 5e71141

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1246
-810
lines changed

analysis_options.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
include: package:very_good_analysis/analysis_options.yaml
1111

1212
analyzer:
13-
exclude: [flutter-sdk/**]
13+
exclude: [flutter-sdk/**, lib/generated/**]
1414

1515
linter:
1616

@@ -26,6 +26,7 @@ linter:
2626
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
2727
# producing the lint.
2828
rules:
29+
document_ignores: false
2930
public_member_api_docs: false
3031
sort_pub_dependencies: false
3132

android/app/build.gradle

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

android/app/build.gradle.kts

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import java.util.Properties
2+
import com.android.build.api.variant.FilterConfiguration.FilterType.*
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
5+
plugins {
6+
id("com.android.application")
7+
id("kotlin-android")
8+
id("dev.flutter.flutter-gradle-plugin")
9+
}
10+
11+
val localPropertiesFile = rootProject.file("local.properties")
12+
val localProperties = Properties()
13+
if (localPropertiesFile.exists()) {
14+
localProperties.load(localPropertiesFile.inputStream())
15+
}
16+
17+
val keystorePropertiesFile = rootProject.file("key.properties")
18+
val keystoreProperties = Properties()
19+
if (keystorePropertiesFile.exists()) {
20+
keystoreProperties.load(keystorePropertiesFile.inputStream())
21+
}
22+
23+
kotlin {
24+
jvmToolchain(21)
25+
compilerOptions {
26+
jvmTarget = JvmTarget.JVM_21
27+
}
28+
}
29+
30+
android {
31+
namespace = "com.mateusrodcosta.apps.vidyamusic"
32+
compileSdk = 35
33+
34+
defaultConfig {
35+
applicationId = "com.mateusrodcosta.apps.vidyamusic"
36+
minSdk = 26
37+
//noinspection OldTargetApi
38+
targetSdk = 34
39+
versionCode = flutter.versionCode
40+
versionName = flutter.versionName
41+
}
42+
43+
signingConfigs {
44+
create("release") {
45+
keyAlias = keystoreProperties["keyAlias"] as String
46+
keyPassword = keystoreProperties["keyPassword"] as String
47+
storeFile = file(keystoreProperties["storeFile"] as String)
48+
storePassword = keystoreProperties["storePassword"] as String
49+
50+
// Always enable v2 and v3 signing schemes, which will be used on modern Android OSes
51+
enableV2Signing = true
52+
enableV3Signing = true
53+
}
54+
}
55+
56+
buildTypes {
57+
getByName("release") {
58+
isMinifyEnabled = true
59+
isShrinkResources = true
60+
proguardFiles(
61+
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
62+
)
63+
signingConfig = signingConfigs.getByName("release")
64+
manifestPlaceholders["appName"] = "Vidya Music"
65+
}
66+
getByName("debug") {
67+
applicationIdSuffix = ".debug"
68+
versionNameSuffix = "-debug"
69+
manifestPlaceholders["appName"] = "Vidya Music (Debug)"
70+
}
71+
getByName("profile") {
72+
applicationIdSuffix = ".profile"
73+
versionNameSuffix = "-profile"
74+
manifestPlaceholders["appName"] = "Vidya Music (Profile)"
75+
}
76+
}
77+
78+
splits {
79+
abi {
80+
isEnable = true
81+
82+
reset()
83+
//noinspection ChromeOsAbiSupport
84+
include("armeabi-v7a", "arm64-v8a", "x86_64")
85+
86+
isUniversalApk = true
87+
}
88+
}
89+
90+
compileOptions {
91+
sourceCompatibility = JavaVersion.VERSION_21
92+
targetCompatibility = JavaVersion.VERSION_21
93+
}
94+
95+
packaging {
96+
// This is set to false starting with minSdk >= 28, but I want uncompressed DEX files with minSdk 26
97+
// According to https://developer.android.com/build/releases/past-releases/agp-4-2-0-release-notes#dex-files-uncompressed-in-apks-when-minsdk-=-28-or-higher:
98+
//
99+
// > This causes an increase in APK size, but it results in a smaller installation size on the device, and the download size is roughly the same.
100+
//
101+
// Currently this makes the APK ~1.4MB heavier
102+
//
103+
dex.useLegacyPackaging = false
104+
resources {
105+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
106+
}
107+
dependenciesInfo {
108+
// Disables dependency metadata when building APKs, for F-Droid.
109+
// As instructed in https://github.com/MateusRodCosta/Share2Storage/issues/44
110+
includeInApk = false
111+
}
112+
}
113+
}
114+
115+
flutter {
116+
source = "../.."
117+
}
118+
119+
dependencies {
120+
implementation("androidx.core:core-splashscreen:1.0.1")
121+
}
122+
123+
val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86_64" to 4)
124+
125+
androidComponents {
126+
onVariants { variant ->
127+
128+
variant.outputs.forEach { output ->
129+
val name = output.filters.find { it.filterType == ABI }?.identifier
130+
131+
val baseAbiCode = abiCodes[name]
132+
133+
if (baseAbiCode != null) {
134+
output.versionCode.set(
135+
// As required by F-Droid, version code at beginning and abi code at the end
136+
// If wanting to build a universal APK with similar naming scheme, do so manually
137+
// via `--build-number` argument from `flutter build apk`
138+
baseAbiCode * 100 + output.versionCode.get()
139+
// Default split apk version code, api code at beginning and version code at the end
140+
//baseAbiVersionCode * 1000 + variant.versionCode
141+
)
142+
}
143+
}
144+
}
145+
}

0 commit comments

Comments
 (0)