Skip to content

Commit

Permalink
IOS Submodule conf. , AndroidManifest useless permission removed, gra…
Browse files Browse the repository at this point in the history
…dle updated and cleanup
  • Loading branch information
Shabinder committed May 20, 2021
1 parent 74aabeb commit 5c1c4ea
Show file tree
Hide file tree
Showing 22 changed files with 99 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "spotiflyer-ios"]
path = spotiflyer-ios
url = https://github.com/Shabinder/spotiflyer-ios
4 changes: 2 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ android {
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
// isShrinkResources = true
if(props.containsKey("storeFileDir")){
signingConfig = signingConfigs.getByName("release")
}
Expand All @@ -77,7 +77,7 @@ android {
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled = true
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Expand Down
1 change: 0 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
</queries>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.shabinder.common.uikit.SpotiFlyerShapes
import com.shabinder.common.uikit.SpotiFlyerTypography
import com.shabinder.common.uikit.colorPrimary

@OptIn(ExperimentalAnimationApi::class)
@ExperimentalAnimationApi
@Composable
fun AnalyticsDialog(
isVisible:Boolean,
Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ allprojects {
useIR = true
}
}
afterEvaluate {
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { kmpExt ->
kmpExt.sourceSets.removeAll { it.name == "androidAndroidTestRelease" }
}
}
}
7 changes: 1 addition & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ plugins {
}

group = "com.shabinder"
version = "2.1"

repositories {
google()
Expand All @@ -31,18 +30,14 @@ repositories {
}

dependencies {
implementation("com.android.tools.build:gradle:4.0.2")
implementation("com.android.tools.build:gradle:7.1.0-alpha01")
implementation("org.jlleitschuh.gradle:ktlint-gradle:${Versions.ktLint}")
implementation(JetBrains.Compose.gradlePlugin)
implementation(JetBrains.Kotlin.gradlePlugin)
implementation(JetBrains.Kotlin.serialization)
implementation(SqlDelight.gradlePlugin)
}

kotlinDslPluginOptions {
experimentalWarning.set(false)
}

kotlin {
// Add Deps to compilation, so it will become available in main project
sourceSets.getByName("main").kotlin.srcDir("buildSrc/src/main/kotlin")
Expand Down
36 changes: 19 additions & 17 deletions buildSrc/src/main/kotlin/android-setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
@file:Suppress("UnstableApiUsage")

/*
* * Copyright (c) 2021 Shabinder Singh
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* * Copyright (c) 2021 Shabinder Singh
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

plugins {
id("com.android.library")
id("ktlint-setup")
}

android {
compileSdkVersion(29)
compileSdk = (29)

defaultConfig {
minSdkVersion(Versions.minSdkVersion)
targetSdkVersion(Versions.targetSdkVersion)
minSdk = (Versions.minSdkVersion)
targetSdk = (Versions.targetSdkVersion)
}

compileOptions {
Expand Down
15 changes: 12 additions & 3 deletions buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ plugins {
id("ktlint-setup")
}

android {
configurations {
create("androidTestApi")
create("androidTestDebugApi")
create("androidTestReleaseApi")
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}
}

kotlin {
jvm("desktop").compilations.all {
kotlinOptions {
Expand Down Expand Up @@ -55,14 +66,12 @@ kotlin {
}
}
}

named("androidMain") {
dependencies {
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.appcompat:appcompat:1.3.0")
implementation(Androidx.core)
}
}

named("desktopMain") {
dependencies {
implementation(compose.desktop.common)
Expand Down
7 changes: 3 additions & 4 deletions buildSrc/src/main/kotlin/multiplatform-setup-test.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
plugins {
id("com.android.library")
id("kotlin-multiplatform")
id("ktlint-setup")
}

kotlin {

/*IOS Target Can be only built on Mac*/
if(HostOS.isMac){
val sdkName: String? = System.getenv("SDK_NAME")
Expand All @@ -43,7 +41,8 @@ kotlin {
useIR = true
}
}
js() {

js {
/*
* TODO Enable JS IR Compiler
* waiting for Decompose & MVI Kotlin to support same
Expand Down Expand Up @@ -78,4 +77,4 @@ kotlin {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
}
}
14 changes: 12 additions & 2 deletions buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ plugins {
id("kotlin-parcelize")
}

kotlin {
android {
configurations {
create("androidTestApi")
create("androidTestDebugApi")
create("androidTestReleaseApi")
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}
}

kotlin {
/*IOS Target Can be only built on Mac*/
if(HostOS.isMac){
val sdkName: String? = System.getenv("SDK_NAME")
Expand All @@ -45,7 +55,7 @@ kotlin {
useIR = true
}
}
js() {
js {
/*
* TODO Enable JS IR Compiler
* waiting for Decompose & MVI Kotlin to support same
Expand Down
24 changes: 23 additions & 1 deletion common/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
import org.jetbrains.compose.compose

plugins {
id("multiplatform-compose-setup")
id("android-setup")
id("multiplatform-compose-setup")
}

kotlin {
sourceSets {
all {
languageSettings.useExperimentalAnnotation("androidx.compose.animation")
}
commonMain {
dependencies {
implementation(compose.materialIconsExtended)
Expand All @@ -35,5 +38,24 @@ kotlin {
implementation(Decompose.extensionsCompose)
}
}

// Testing Source-sets
named("commonTest") {
dependencies {
implementation(JetBrains.Kotlin.testCommon)
implementation(JetBrains.Kotlin.testAnnotationsCommon)
}
}

named("androidTest") {
dependencies {
implementation(JetBrains.Kotlin.testJunit)
}
}
named("desktopTest") {
dependencies {
implementation(JetBrains.Kotlin.testJunit)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fun SpotiFlyerListContent(
item {
CoverImage(result.title, result.coverUrl, component::loadImage)
}
itemsIndexed(model.trackList) { index, item ->
itemsIndexed(model.trackList) { _, item ->
TrackCard(
track = item,
downloadTrack = { component.onDownloadClicked(item) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fun HomeTabBar(

TabRow(
selectedTabIndex = selectedIndex,
indicator = indicator as @Composable (List<TabPosition>) -> Unit,
indicator = indicator,
modifier = modifier,
) {
categories.forEachIndexed { index, category ->
Expand Down
8 changes: 3 additions & 5 deletions common/data-models/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
id("kotlin-parcelize")
kotlin("plugin.serialization")
}
Expand Down Expand Up @@ -46,10 +47,7 @@ kotlin {
}
}
androidMain {
dependencies {
api("com.github.K1rakishou:Fuck-Storage-Access-Framework:v1.1")
api("androidx.documentfile:documentfile:1.0.1")
}
dependencies {}
}
}
}
3 changes: 2 additions & 1 deletion common/database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
id("com.squareup.sqldelight")
}

Expand Down
3 changes: 2 additions & 1 deletion common/dependency-injection/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import org.jetbrains.compose.compose

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
kotlin("plugin.serialization")
}

Expand Down
3 changes: 2 additions & 1 deletion common/list/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
id("kotlin-parcelize")
}

Expand Down
3 changes: 2 additions & 1 deletion common/main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
id("kotlin-parcelize")
}

Expand Down
3 changes: 2 additions & 1 deletion common/root/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
*/

plugins {
id("multiplatform-setup")
id("android-setup")
id("multiplatform-setup")
id("multiplatform-setup-test")
id("kotlin-parcelize")
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=e2774e6fb77c43657decde25542dea710aafd78c4022d19b196e7e78d79d8c6c
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionSha256Sum=0e46229820205440b48a5501122002842b82886e76af35f0f3a069243dca4b3c
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

rootProject.name = "spotiflyer"
enableFeaturePreview("GRADLE_METADATA")

include(
":common:database",
Expand All @@ -25,7 +24,6 @@ include(
":common:list",
":common:data-models",
":common:dependency-injection",
":fuzzywuzzy:app",
":android",
":desktop",
":web-app",
Expand Down
1 change: 1 addition & 0 deletions spotiflyer-ios
Submodule spotiflyer-ios added at 30c168

0 comments on commit 5c1c4ea

Please sign in to comment.