Skip to content

Commit bf29f7e

Browse files
committed
[User Model] Core Module
* Make `OneSignal` module a psuedo project which brings in all subprojects. * Move `OneSignal` functionality down to new `core` subproject. * All other subprojects now depend on `OneSignal:core` instead of `OneSignal`. * Finalize new build/publishing scheme.
1 parent d32966b commit bf29f7e

File tree

322 files changed

+208
-138
lines changed

Some content is hidden

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

322 files changed

+208
-138
lines changed

Examples/OneSignalDemo/app/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,13 @@ dependencies {
6767

6868
implementation 'com.github.bumptech.glide:glide:4.12.0'
6969

70-
implementation('com.onesignal:OneSignal:4.8.2')
71-
implementation('com.onesignal:Location:4.8.2')
72-
implementation('com.onesignal:InAppMessages:4.8.2')
73-
7470
/** START - Google Play Builds **/
75-
gmsImplementation('com.onesignal:Notifications:4.8.2')
71+
gmsImplementation('com.onesignal:OneSignal:5.0.0')
7672
/** END - Google Play Builds **/
7773

7874
/** START - Huawei Builds **/
7975
// Omit Google / Firebase libraries for Huawei builds.
80-
huaweiImplementation('com.onesignal:Notifications:4.8.2') {
76+
huaweiImplementation('com.onesignal:OneSignal:5.0.0') {
8177
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
8278
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
8379
exclude group: 'com.google.android.gms', module: 'play-services-location'

OneSignalSDK/onesignal/build.gradle

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
plugins {
22
id 'com.android.library'
3-
id 'kotlin-android'
4-
id 'org.jlleitschuh.gradle.ktlint'
5-
id 'io.gitlab.arturbosch.detekt'
63
}
74

85
android {
96
compileSdkVersion rootProject.buildVersions.compileSdkVersion
107
defaultConfig {
118
minSdkVersion rootProject.buildVersions.minSdkVersion
12-
consumerProguardFiles 'consumer-rules.pro'
13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
149
}
1510

1611
buildTypes {
1712
original {
1813
minifyEnabled false
19-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2014
}
2115
release {
2216
minifyEnabled false
@@ -25,72 +19,23 @@ android {
2519
minifyEnabled false
2620
}
2721
}
28-
testOptions {
29-
unitTests.all {
30-
maxParallelForks 1
31-
maxHeapSize '2048m'
32-
}
33-
unitTests {
34-
includeAndroidResources = true
35-
}
36-
}
3722
// Forced downgrade to Java 8 so SDK is backwards compatible in consuming projects
3823
compileOptions {
3924
sourceCompatibility JavaVersion.VERSION_1_8
4025
targetCompatibility JavaVersion.VERSION_1_8
4126
}
42-
kotlinOptions {
43-
jvmTarget = '1.8'
44-
}
4527
namespace 'com.onesignal'
4628
}
4729

48-
tasks.withType(Test) {
49-
testLogging {
50-
exceptionFormat "full"
51-
events "started", "skipped", "passed", "failed"
52-
showStandardStreams false // Enable to have logging print
53-
}
30+
ext {
31+
projectDescription = "OneSignal Android SDK - All Modules"
5432
}
5533

56-
// api || implementation = compile and runtime
57-
58-
// KEEP: version ranges, these get used in the released POM file for maven central
59-
// NOTE: To prevent consumers from getting alpha or beta version of dependencies listed here
60-
// make sure the latest minor value is a known stable version. Using a range for the
61-
// patch version is ok, since this allows getting bug fix versions.
6234
dependencies {
63-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
64-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
65-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
66-
67-
compileOnly('com.amazon.device:amazon-appstore-sdk:[3.0.1, 3.0.99]')
68-
69-
api('androidx.legacy:legacy-support-v4') {
70-
version {
71-
require '[1.0.0, 1.0.99]'
72-
prefer '1.0.0'
73-
}
74-
}
75-
api('androidx.appcompat:appcompat') {
76-
version {
77-
require '[1.0.0, 1.3.99]'
78-
prefer '1.3.1'
79-
}
80-
}
81-
82-
testImplementation("junit:junit:$junitVersion")
83-
testImplementation("io.kotest:kotest-runner-junit4:$kotestVersion")
84-
testImplementation("io.kotest:kotest-runner-junit4-jvm:$kotestVersion")
85-
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
86-
testImplementation("io.kotest:kotest-property:$kotestVersion")
87-
testImplementation("org.robolectric:robolectric:4.8.1")
88-
testImplementation("androidx.test:core-ktx:1.4.0")
89-
testImplementation("androidx.test:core:1.4.0")
90-
testImplementation("io.mockk:mockk:1.13.2")
91-
testImplementation("org.json:json:20180813")
92-
testImplementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
35+
api project(':OneSignal:core')
36+
api project(':OneSignal:notifications')
37+
api project(':OneSignal:in-app-messages')
38+
api project(':OneSignal:location')
9339
}
9440

9541
apply from: 'maven-push.gradle'
96-
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
id 'org.jlleitschuh.gradle.ktlint'
5+
id 'io.gitlab.arturbosch.detekt'
6+
}
7+
8+
android {
9+
compileSdkVersion rootProject.buildVersions.compileSdkVersion
10+
defaultConfig {
11+
minSdkVersion rootProject.buildVersions.minSdkVersion
12+
consumerProguardFiles "consumer-rules.pro"
13+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
}
15+
16+
buildTypes {
17+
original {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
release {
22+
minifyEnabled false
23+
}
24+
unity {
25+
minifyEnabled false
26+
}
27+
}
28+
testOptions {
29+
unitTests.all {
30+
maxParallelForks 1
31+
maxHeapSize '2048m'
32+
}
33+
unitTests {
34+
includeAndroidResources = true
35+
}
36+
}
37+
compileOptions {
38+
sourceCompatibility JavaVersion.VERSION_1_8
39+
targetCompatibility JavaVersion.VERSION_1_8
40+
}
41+
kotlinOptions {
42+
jvmTarget = '1.8'
43+
}
44+
namespace 'com.onesignal.core'
45+
}
46+
47+
tasks.withType(Test) {
48+
testLogging {
49+
exceptionFormat "full"
50+
events "started", "skipped", "passed", "failed"
51+
showStandardStreams false // Enable to have logging print
52+
}
53+
}
54+
55+
ext {
56+
projectDescription = "OneSignal Android SDK - Core Module"
57+
}
58+
59+
dependencies {
60+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
61+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
62+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
63+
64+
compileOnly('com.amazon.device:amazon-appstore-sdk:[3.0.1, 3.0.99]')
65+
66+
api('androidx.legacy:legacy-support-v4') {
67+
version {
68+
require '[1.0.0, 1.0.99]'
69+
prefer '1.0.0'
70+
}
71+
}
72+
api('androidx.appcompat:appcompat') {
73+
version {
74+
require '[1.0.0, 1.3.99]'
75+
prefer '1.3.1'
76+
}
77+
}
78+
79+
testImplementation("junit:junit:$junitVersion")
80+
testImplementation("io.kotest:kotest-runner-junit4:$kotestVersion")
81+
testImplementation("io.kotest:kotest-runner-junit4-jvm:$kotestVersion")
82+
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
83+
testImplementation("io.kotest:kotest-property:$kotestVersion")
84+
testImplementation("org.robolectric:robolectric:4.8.1")
85+
testImplementation("androidx.test:core-ktx:1.4.0")
86+
testImplementation("androidx.test:core:1.4.0")
87+
testImplementation("io.mockk:mockk:1.13.2")
88+
testImplementation("org.json:json:20180813")
89+
testImplementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
90+
}
91+
92+
apply from: '../maven-push.gradle'
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
3+
<!-- Required so the device can access the internet. -->
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
7+
<application>
8+
<service
9+
android:name="com.onesignal.core.services.SyncService"
10+
android:stopWithTask="true"
11+
android:exported="false" />
12+
13+
<service
14+
android:name="com.onesignal.core.services.SyncJobService"
15+
android:permission="android.permission.BIND_JOB_SERVICE"
16+
android:exported="false" />
17+
18+
<activity android:name="com.onesignal.core.activities.PermissionsActivity"
19+
android:theme="@android:style/Theme.Translucent.NoTitleBar"
20+
android:exported="false" />
21+
</application>
22+
23+
<!-- NOTE: See release version for tags with placeholders -->
24+
</manifest>

0 commit comments

Comments
 (0)