Skip to content

Commit 6e3aba5

Browse files
committed
Changes required for Gradle update + MavenCentral artifact implementation
1 parent b01eff1 commit 6e3aba5

File tree

14 files changed

+122
-103
lines changed

14 files changed

+122
-103
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ example/.flutter-plugins
3838
example/.flutter-plugins-dependencies
3939

4040

41+
42+

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ dependencies {
5959

6060
// Gigya SDK core implementation.
6161
api 'com.sap.oss.gigya-android-sdk:sdk-core:7.1.+'
62-
api 'com.github.SAP.gigya-android-sdk:sdk-auth:auth-v2.2.0'
63-
api 'com.github.SAP.gigya-android-sdk:sdk-biometric:bio-v2.1.+'
62+
api 'com.sap.oss.gigya-android-sdk:sdk-auth:2.2.+'
63+
api 'com.sap.oss.gigya-android-sdk:sdk-bio:2.1.+'
6464

6565
api 'com.google.code.gson:gson:2.8.9'
6666

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

example/android/app/build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,8 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdkVersion 34
26+
compileSdkVersion 35
3027

3128
sourceSets {
3229
main.java.srcDirs += 'src/main/kotlin'
@@ -38,14 +35,18 @@ android {
3835
}
3936

4037
compileOptions {
41-
sourceCompatibility JavaVersion.VERSION_1_8
42-
targetCompatibility JavaVersion.VERSION_1_8
38+
sourceCompatibility JavaVersion.VERSION_17
39+
targetCompatibility JavaVersion.VERSION_17
40+
}
41+
42+
kotlinOptions {
43+
jvmTarget = "17"
4344
}
4445

4546
defaultConfig {
4647
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4748
applicationId "com.sap.gigya_flutter_plugin_example"
48-
minSdkVersion 23
49+
minSdkVersion 24
4950
targetSdkVersion 33
5051
versionCode flutterVersionCode.toInteger()
5152
versionName flutterVersionName
@@ -71,7 +72,6 @@ flutter {
7172
}
7273

7374
dependencies {
74-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7575
implementation "androidx.multidex:multidex:2.0.1"
7676

7777
// Needed when implementing Gigya SDK activity based operations.

example/android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,9 @@
9292
android:theme="@android:style/Theme.Translucent.NoTitleBar">
9393
</activity>
9494

95+
<meta-data
96+
android:name="com.gigya.android.externalProvidersPath"
97+
android:value="gigya.providers" />
98+
9599
</application>
96100
</manifest>

example/android/app/src/main/kotlin/com/sap/gigya_flutter_plugin_example/MainActivity.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ import android.content.pm.PackageManager
44
import android.os.Bundle
55
import android.util.Base64
66
import android.util.Log
7-
import io.flutter.embedding.android.FlutterFragmentActivity
7+
import android.webkit.WebView
8+
import io.flutter.embedding.android.FlutterActivity
89
import java.security.MessageDigest
910
import java.security.NoSuchAlgorithmException
1011

11-
class MainActivity : FlutterFragmentActivity() {
12+
class MainActivity : FlutterActivity() {
1213

1314
override fun onCreate(savedInstanceState: Bundle?) {
1415
super.onCreate(savedInstanceState)
16+
17+
WebView.setWebContentsDebuggingEnabled(true)
1518
getSignature()
1619
}
1720

1821
// Call function to get the application signature used for Facebook login or Fido authentication.
1922
private fun getSignature() {
2023
try {
2124
val info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES)
22-
for (signature in info.signatures) {
25+
for (signature in info.signatures!!) {
2326
val md: MessageDigest = MessageDigest.getInstance("SHA256")
2427
md.update(signature.toByteArray())
2528
Log.e(

example/android/build.gradle

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
buildscript {
2-
ext {
3-
kotlin_version = '1.8.0'
4-
gradle_version = '7.4.2'
5-
}
6-
7-
repositories {
8-
google()
9-
mavenCentral()
10-
}
11-
12-
dependencies {
13-
classpath "com.android.tools.build:gradle:$gradle_version"
14-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
}
16-
}
17-
181
allprojects {
192
repositories {
203
google()

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
21+
id "com.android.application" version "8.2.1" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.0" apply false
23+
}
24+
25+
include ":app"

example/ios/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ post_install do |installer|
3939
flutter_additional_ios_build_settings(target)
4040
end
4141
end
42+
prpro

0 commit comments

Comments
 (0)