Skip to content

Commit

Permalink
Converts MagicWeather's Gradle files to Kotlin (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayShortway authored Aug 23, 2024
1 parent 4c89ab6 commit aef0c00
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 100 deletions.
65 changes: 0 additions & 65 deletions examples/MagicWeather/app/build.gradle

This file was deleted.

65 changes: 65 additions & 0 deletions examples/MagicWeather/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
val compileVersion = 34
compileSdk = compileVersion

defaultConfig {
applicationId = "com.revenuecat.purchases_sample"
minSdk = 26
targetSdk = compileVersion
versionCode = rootProject.extra.get("versionCode")?.toString()?.toInt()
versionName = rootProject.extra.get("versionName")?.toString()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

flavorDimensions += "store"
productFlavors {
create("amazon") {
dimension = "store"
buildConfigField("String", "STORE", "\"amazon\"")
}

create("google") {
dimension = "store"
buildConfigField("String", "STORE", "\"google\"")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
namespace = "com.revenuecat.sample"
}

dependencies {
implementation(libs.revenuecat)
implementation(libs.revenuecat.amazon)
implementation(libs.kotlin.stdlib)
implementation(libs.androidx.core)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.lifecycle.livedata)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
}
4 changes: 2 additions & 2 deletions examples/MagicWeather/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand All @@ -20,4 +20,4 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.revenuecat.purchases.** { *; }
-keep class com.revenuecat.purchases.** { *; }
21 changes: 0 additions & 21 deletions examples/MagicWeather/build.gradle

This file was deleted.

17 changes: 17 additions & 0 deletions examples/MagicWeather/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
}

allprojects {
repositories {
google()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
}

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
11 changes: 0 additions & 11 deletions examples/MagicWeather/settings.gradle

This file was deleted.

11 changes: 11 additions & 0 deletions examples/MagicWeather/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
google()
gradlePluginPortal()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
}

include(":app")
rootProject.name = "MagicWeatherKotlin"
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ DESC
# Application Id
if new_application_id.to_s.size > 0
application_id = "com.revenuecat.purchases_sample"
sh("find ../#{project_dir}/app -name 'build.gradle' -type f -exec sed -i '' 's/#{application_id}/#{new_application_id}/' {} \\;")
sh("find ../#{project_dir}/app -name 'build.gradle.kts' -type f -exec sed -i '' 's/#{application_id}/#{new_application_id}/' {} \\;")
end

# Amazon pem
Expand Down

0 comments on commit aef0c00

Please sign in to comment.