Skip to content

Commit

Permalink
added windows app id and migrated android build
Browse files Browse the repository at this point in the history
  • Loading branch information
prijindal committed May 1, 2024
1 parent 7a50ab4 commit eb5f1f3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json
env:
FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}}
- run: flutterfire configure -y --platforms=android --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker
- run: flutterfire configure -y --platforms=android --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=com.prijindal.habbit-tracker
env:
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json
- run: flutter build appbundle --release
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
- run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json
env:
FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}}
- run: flutterfire configure -y --platforms=web --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker
- run: flutterfire configure -y --platforms=web --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=com.prijindal.habbit-tracker
env:
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json
- run: flutter build web --release
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
# - run: echo "$FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL" > google-application-credentials.json
# env:
# FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL: ${{secrets.FIREBASE_SERVICE_ACCOUNT_HABBIT_TRACKER_PRIJINDAL}}
# - run: flutterfire configure -y --platforms=macos,ios --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker
# - run: flutterfire configure -y --platforms=macos,ios --ios-bundle-id=com.prijindal.habbit-tracker --macos-bundle-id=com.prijindal.habbit-tracker --web-app-id=1:739292996360:web:5c24f4c3b47c73559e82bd --android-package-name=com.prijindal.habbit_tracker --windows-app-id=com.prijindal.habbit-tracker
# env:
# GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json
# - run: flutter build macos --release
Expand Down
19 changes: 7 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
Expand All @@ -22,10 +23,6 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.prijindal.habbit_tracker"
compileSdkVersion flutter.compileSdkVersion
Expand Down Expand Up @@ -111,6 +108,4 @@ flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
dependencies {}
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"

0 comments on commit eb5f1f3

Please sign in to comment.