Skip to content

Commit

Permalink
Merge branch 'main' into update_icons
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbyESP authored Aug 12, 2024
2 parents 38be352 + 8fbb8d6 commit 3a9c070
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 81 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Join our [Telegram Channel](https://t.me/seal_app) or [Matrix Space](https://mat

## 💖 Sponsors

<p><!-- sponsors --><a href="https://github.com/4kaimar"><img src="https://github.com/4kaimar.png" width="60px" alt="" /></a><a href="https://github.com/gordongw"><img src="https://github.com/gordongw.png" width="60px" alt="Gordon" /></a><a href="https://github.com/zuble"><img src="https://github.com/zuble.png" width="60px" alt="zuble" /></a><a href="https://github.com/Dannyordaniel"><img src="https://github.com/Dannyordaniel.png" width="60px" alt="Daniel " /></a><a href="https://github.com/hundepfote"><img src="https://github.com/hundepfote.png" width="60px" alt="hundepfote" /></a><!-- sponsors --></p>
<p><!-- sponsors --><a href="https://github.com/4kaimar"><img src="https://github.com/4kaimar.png" width="60px" alt="" /></a><a href="https://github.com/gordongw"><img src="https://github.com/gordongw.png" width="60px" alt="Gordon" /></a><a href="https://github.com/zuble"><img src="https://github.com/zuble.png" width="60px" alt="zuble" /></a><a href="https://github.com/Dannyordaniel"><img src="https://github.com/Dannyordaniel.png" width="60px" alt="Daniel " /></a><a href="https://github.com/NRN83"><img src="https://github.com/NRN83.png" width="60px" alt="" /></a><!-- sponsors --></p>


Seal will be always free and open source for everyone. If you like it, please consider [sponsoring me](https://github.com/sponsors/JunkFood02)!
Expand Down
75 changes: 10 additions & 65 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,15 @@ plugins {
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.room)
}

sealed class Version(
open val versionMajor: Int,
val versionMinor: Int,
val versionPatch: Int,
val versionBuild: Int = 0
) {
abstract fun toVersionName(): String
class Alpha(versionMajor: Int, versionMinor: Int, versionPatch: Int, versionBuild: Int) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-alpha.$versionBuild"
}

class Beta(versionMajor: Int, versionMinor: Int, versionPatch: Int, versionBuild: Int) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-beta.$versionBuild"
}

class Stable(versionMajor: Int, versionMinor: Int, versionPatch: Int) :
Version(versionMajor, versionMinor, versionPatch) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}"
}

class ReleaseCandidate(
versionMajor: Int,
versionMinor: Int,
versionPatch: Int,
versionBuild: Int
) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-rc.$versionBuild"
}
}

val currentVersion: Version = Version.Alpha(
versionMajor = 2,
versionMinor = 0,
versionPatch = 0,
versionBuild = 2
)

val keystorePropertiesFile: File = rootProject.file("keystore.properties")

val splitApks = !project.hasProperty("noSplits")

val abiFilterList = (properties["ABI_FILTERS"] as String).split(';')


android {
if (keystorePropertiesFile.exists()) {
val keystoreProperties = Properties()
Expand All @@ -80,13 +36,11 @@ android {

compileSdk = 34



defaultConfig {
applicationId = "com.junkfood.seal"
minSdk = 24
targetSdk = 34
versionCode = 20000
versionCode = 20000 // (rootProject.extra["versionCode"] as Int) -- Can't be used because of F-droid

if (splitApks) {
splits {
Expand All @@ -99,24 +53,27 @@ android {
}
}

versionName = currentVersion.toVersionName().run {
versionName = (rootProject.extra["versionName"] as String).run {
if (!splitApks) "$this-(F-Droid)"
else this
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
ksp {
arg(RoomSchemaArgProvider(File(projectDir, "schemas")))
arg("room.incremental", "true")
}

if (!splitApks) {
ndk {
abiFilters.addAll(abiFilterList)
}
}
}
room {
schemaDirectory("$projectDir/schemas")
}
ksp {
arg("room.incremental", "true") //Still not supported by the Room plugin
}
val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 3, "x86_64" to 4)

androidComponents {
Expand Down Expand Up @@ -246,16 +203,4 @@ dependencies {
androidTestImplementation(libs.androidx.test.ext)
androidTestImplementation(libs.androidx.test.espresso.core)
implementation(libs.androidx.compose.ui.tooling)

}

class RoomSchemaArgProvider(
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val schemaDir: File
) : CommandLineArgumentProvider {

override fun asArguments(): Iterable<String> {
return listOf("room.schemaLocation=${schemaDir.path}")
}
}
77 changes: 66 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,79 @@
@file:Suppress("UnstableApiUsage")
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.room) apply false
}

buildscript {

repositories {
mavenCentral()
google()
}
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
sealed class Version(
open val versionMajor: Int,
val versionMinor: Int,
val versionPatch: Int,
val versionBuild: Int = 0
) {
abstract fun toVersionName(): String

fun toVersionCode(): Int {
val minor = versionMinor.toString().padStart(2, '0')
val patch = versionPatch.toString().padStart(2, '0')

// Combining the version components, ensuring the result is 5 digits
// We suppose that the major version won't be greater than 9
return "$versionMajor$minor$patch".toInt()
}


class Alpha(versionMajor: Int, versionMinor: Int, versionPatch: Int, versionBuild: Int) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-alpha.$versionBuild"
}

class Beta(versionMajor: Int, versionMinor: Int, versionPatch: Int, versionBuild: Int) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-beta.$versionBuild"
}

class Stable(versionMajor: Int, versionMinor: Int, versionPatch: Int) :
Version(versionMajor, versionMinor, versionPatch) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}"
}

class ReleaseCandidate(
versionMajor: Int,
versionMinor: Int,
versionPatch: Int,
versionBuild: Int
) :
Version(versionMajor, versionMinor, versionPatch, versionBuild) {
override fun toVersionName(): String =
"${versionMajor}.${versionMinor}.${versionPatch}-rc.$versionBuild"
}
}

val currentVersion: Version = Version.Alpha(
versionMajor = 2,
versionMinor = 0,
versionPatch = 0,
versionBuild = 2
)

val versionCode by extra(currentVersion.toVersionCode())
val versionName by extra(currentVersion.toVersionName())

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}

1 change: 0 additions & 1 deletion color/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ dependencies {
api(libs.androidx.core.ktx)
api(libs.androidx.compose.foundation)
api(libs.androidx.compose.material3)

}
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ androidxSplashscreen = "1.0.1"
androidxLifecycle = "2.8.4"
androidxNavigation = "2.7.7"
androidxFoundation = "1.6.0-beta03"
androidxComposeMaterial3 = "1.2.0-beta01"
androidxComposeMaterial3 = "1.3.0-alpha06"
androidxComposeAnimation = "1.5.0-beta01"

androidxEspresso = "3.5.0"
Expand Down Expand Up @@ -62,7 +62,7 @@ androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }

androidx-compose-material = { group = "androidx.compose.material", name = "material" }

androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version = "1.3.0-alpha06" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" }
androidx-compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }

okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
Expand Down Expand Up @@ -110,6 +110,7 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
room = { id = "androidx.room", version.ref = "room" }

[bundles]
accompanist = [
Expand Down

0 comments on commit 3a9c070

Please sign in to comment.