Skip to content

Commit 55069e8

Browse files
authored
Revert "Upgrade audio_streamer to Java 21 and Kotlin 21"
1 parent a3684db commit 55069e8

File tree

15 files changed

+123
-107
lines changed

15 files changed

+123
-107
lines changed

packages/audio_streamer/CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
## 4.2.1
2-
3-
* Update example app and outdated libraries
4-
* Upgraded Gradle
5-
61
## 4.2.0
72

83
* Gradle files restructure for example app

packages/audio_streamer/android/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ group 'plugins.cachet.audio_streamer'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '2.2.0'
5+
ext.kotlin_version = '1.9.22'
66
repositories {
77
google()
88
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.11.0'
12+
classpath 'com.android.tools.build:gradle:8.2.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -25,16 +25,16 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28-
compileSdk flutter.compileSdkVersion
28+
compileSdkVersion flutter.compileSdkVersion
2929
ndkVersion flutter.ndkVersion
3030

3131
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_21
33-
targetCompatibility JavaVersion.VERSION_21
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
3434
}
3535

3636
kotlinOptions {
37-
jvmTarget = '21'
37+
jvmTarget = '1.8'
3838
}
3939
sourceSets {
4040
main.java.srcDirs += 'src/main/kotlin'
@@ -45,7 +45,7 @@ android {
4545
}
4646

4747
defaultConfig {
48-
minSdkVersion 21
48+
minSdkVersion 16
4949
targetSdkVersion flutter.targetSdkVersion
5050
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5151
}
Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,72 @@
11
plugins {
2-
id("com.android.application")
3-
id("kotlin-android")
4-
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5-
id("dev.flutter.flutter-gradle-plugin")
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
623
}
724

825
android {
9-
namespace = "plugins.cachet.audio_streamer_example"
10-
compileSdk = flutter.compileSdkVersion
11-
ndkVersion = "27.0.12077973"
26+
namespace 'plugins.cachet.audio_streamer_example'
27+
compileSdkVersion flutter.compileSdkVersion
1228

13-
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_17
15-
targetCompatibility = JavaVersion.VERSION_17
29+
sourceSets {
30+
main.java.srcDirs += 'src/main/kotlin'
1631
}
1732

18-
buildFeatures {
19-
buildConfig = true
33+
compileOptions {
34+
sourceCompatibility JavaVersion.VERSION_1_8
35+
targetCompatibility JavaVersion.VERSION_1_8
2036
}
21-
37+
2238
kotlinOptions {
23-
jvmTarget = JavaVersion.VERSION_17.toString()
39+
jvmTarget = '1.8'
40+
}
41+
42+
lint {
43+
disable 'InvalidPackage'
2444
}
2545

2646
defaultConfig {
2747
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
28-
applicationId = "plugins.cachet.audio_streamer_example"
29-
// You can update the following values to match your application needs.
30-
// For more information, see: https://flutter.dev/to/review-gradle-config.
31-
minSdk = flutter.minSdkVersion
32-
targetSdk = flutter.targetSdkVersion
33-
versionCode = flutter.versionCode
34-
versionName = flutter.versionName
48+
applicationId "plugins.cachet.audio_streamer_example"
49+
minSdkVersion 28
50+
targetSdkVersion flutter.targetSdkVersion
51+
versionCode flutterVersionCode.toInteger()
52+
versionName flutterVersionName
3553
}
3654

3755
buildTypes {
3856
release {
3957
// TODO: Add your own signing config for the release build.
4058
// Signing with the debug keys for now, so `flutter run --release` works.
41-
signingConfig = signingConfigs.getByName("debug")
59+
signingConfig signingConfigs.debug
4260
}
4361
}
4462
}
4563

4664
flutter {
47-
source = "../.."
65+
source '../..'
4866
}
4967

50-
5168
dependencies {
52-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.13.2'
53-
androidTestImplementation 'androidx.test:runner:1.6.2'
54-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
69+
testImplementation 'junit:junit:4.13.2'
70+
androidTestImplementation 'androidx.test:runner:1.5.2'
71+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
5572
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package plugins.cachet.audio_streamer_example
22

3+
import androidx.annotation.NonNull;
34
import io.flutter.embedding.android.FlutterActivity
5+
import io.flutter.embedding.engine.FlutterEngine
6+
import io.flutter.plugins.GeneratedPluginRegistrant
47

5-
class MainActivity : FlutterActivity()
8+
class MainActivity: FlutterActivity() {
9+
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10+
GeneratedPluginRegistrant.registerWith(flutterEngine);
11+
}
12+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
rootProject.buildDir = '../build'
9+
subprojects {
10+
project.buildDir = "${rootProject.buildDir}/${project.name}"
11+
}
12+
subprojects {
13+
project.evaluationDependsOn(':app')
14+
}
15+
16+
tasks.register("clean", Delete) {
17+
delete rootProject.buildDir
18+
}

packages/audio_streamer/example/android/build.gradle.kts

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
1+
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
23
android.useAndroidX=true
34
android.enableJetifier=true
5+
android.defaults.buildfeatures.buildconfig=true
46
android.nonTransitiveRClass=false
57
android.nonFinalResIds=false
68

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Sun Mar 12 17:19:03 CST 2023
12
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
24
distributionPath=wrapper/dists
3-
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
6+
zipStoreBase=GRADLE_USER_HOME
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
}()
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
23+
}
24+
25+
include ":app"

packages/audio_streamer/example/android/settings.gradle.kts

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)