Skip to content

Commit 7ac1721

Browse files
authored
Merge pull request #406 from transistorsoft/package-management
[RELEASE] 1.5.0:
2 parents 34f2177 + b4ec1e0 commit 7ac1721

File tree

85 files changed

+229
-1704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+229
-1704
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ ios/.generated
1212
pubspec.lock
1313
doc/
1414
build/
15+
ios/background_fetch/Package.resolved
16+

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 1.5.0 — 2025-11-09
4+
* Both the plugin's iOS and Android core libs (`TSBackgroundFetch.xcframework`, `tsbackgroundfetch.aar`) are now published to Cocoapods, Swift Package Manager and Sonatype for android. This is especially wonderful for android, as now there's no more need of the custom `maven url` in the root `build.gradle`.
5+
* See the Setup Guides for both iOS and Android (they have changed from previous versions).
6+
37
## 1.4.0 — 2025-07-28
48
* [iOS] Add Swift Package Manager support
59

android/build.gradle

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,43 @@
1+
plugins {
2+
id 'com.android.library'
3+
}
4+
15
group 'com.transistorsoft.flutter.backgroundfetch'
26
version '1.0-SNAPSHOT'
37

4-
def DEFAULT_LIFE_CYCLE_RUNTIME_VERSION = "2.8.7"
5-
def DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION = "2.2.0"
6-
7-
buildscript {
8-
repositories {
9-
google()
10-
mavenCentral()
11-
}
8+
def safeExtGet(prop, fallback) {
9+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
1210
}
1311

14-
rootProject.allprojects {
15-
repositories {
16-
google()
17-
mavenCentral()
18-
maven {
19-
url './libs'
20-
}
21-
}
22-
}
23-
24-
apply plugin: 'com.android.library'
25-
26-
def safeExtGet(prop, fallback) {
27-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12+
repositories {
13+
// In case the root doesn’t already declare these
14+
google()
15+
mavenCentral()
2816
}
2917

3018
android {
31-
if (project.android.hasProperty("namespace")) {
32-
namespace("com.transistorsoft.flutter.backgroundfetch")
33-
}
34-
35-
compileSdkVersion safeExtGet('compileSdkVersion', 34)
36-
37-
defaultConfig {
38-
minSdkVersion 16
39-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
40-
}
41-
compileOptions {
42-
sourceCompatibility JavaVersion.VERSION_11
43-
targetCompatibility JavaVersion.VERSION_11
44-
}
45-
lintOptions {
46-
disable 'InvalidPackage'
47-
}
48-
}
19+
namespace "com.transistorsoft.flutter.backgroundfetch"
4920

50-
dependencies {
51-
def lifeCycleRuntimeVersion = safeExtGet('lifeCycleRuntimeVersion', DEFAULT_LIFE_CYCLE_RUNTIME_VERSION)
52-
def lifeCycleExtensionsVersion = safeExtGet('lifeCycleExtensionsVersion', DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION)
21+
// AGP 7+ accepts `compileSdk`; keep the fallback so examples can override.
22+
compileSdk safeExtGet('compileSdkVersion', 36)
5323

54-
implementation(group: 'com.transistorsoft', name:'tsbackgroundfetch', version: '+')
24+
defaultConfig {
25+
minSdkVersion 21
26+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
27+
consumerProguardFiles 'consumer-rules.pro'
28+
}
5529

56-
// LifeCycleObserver
57-
implementation "androidx.lifecycle:lifecycle-runtime:$lifeCycleRuntimeVersion"
58-
implementation "androidx.lifecycle:lifecycle-extensions:$lifeCycleExtensionsVersion"
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_17
32+
targetCompatibility JavaVersion.VERSION_17
33+
}
34+
35+
lint {
36+
disable += ['InvalidPackage']
37+
}
5938
}
39+
40+
dependencies {
41+
def backgroundFetchVersion = safeExtGet('backgroundFetchVersion', '4.0.+')
42+
implementation "com.transistorsoft:tsbackgroundfetch:$backgroundFetchVersion"
43+
}

android/consumer-rules.pro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# --- TSBackgroundFetch: keep Android components referenced from the manifest ---
2+
-keep class com.transistorsoft.tsbackgroundfetch.FetchJobService
3+
-keep class com.transistorsoft.tsbackgroundfetch.FetchAlarmReceiver
4+
-keep class com.transistorsoft.tsbackgroundfetch.BootReceiver
5+
6+
# (Optional but harmless) Quiet any lifecycle warnings in consumer builds
7+
-dontwarn androidx.lifecycle.**
8+
Binary file not shown.

android/libs/com/transistorsoft/tsbackgroundfetch/1.0.3/tsbackgroundfetch-1.0.3.aar.md5

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/libs/com/transistorsoft/tsbackgroundfetch/1.0.3/tsbackgroundfetch-1.0.3.aar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/libs/com/transistorsoft/tsbackgroundfetch/1.0.3/tsbackgroundfetch-1.0.3.aar.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/libs/com/transistorsoft/tsbackgroundfetch/1.0.3/tsbackgroundfetch-1.0.3.aar.sha512

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/libs/com/transistorsoft/tsbackgroundfetch/1.0.3/tsbackgroundfetch-1.0.3.pom

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

0 commit comments

Comments
 (0)