unimodules-app-loader 2.1.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/android/build.gradle +37 -29
- package/ios/UMAppLoader.podspec +2 -1
- package/package.json +2 -2
- package/android/src/main/java/org/unimodules/apploader/AppLoaderPackagesProviderInterface.java +0 -17
- package/android/src/main/java/org/unimodules/apploader/AppLoaderProvider.java +0 -50
- package/android/src/main/java/org/unimodules/apploader/HeadlessAppLoader.java +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,40 @@
|
|
|
8
8
|
|
|
9
9
|
### 🐛 Bug fixes
|
|
10
10
|
|
|
11
|
+
### 💡 Others
|
|
12
|
+
|
|
13
|
+
## 3.0.1 — 2022-02-01
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
## 3.0.0 — 2021-09-28
|
|
20
|
+
|
|
21
|
+
### 🛠 Breaking changes
|
|
22
|
+
|
|
23
|
+
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug fixes
|
|
26
|
+
|
|
27
|
+
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
|
|
28
|
+
|
|
29
|
+
## 2.3.0-alpha.0 — 2021-08-17
|
|
30
|
+
|
|
31
|
+
### 🎉 New features
|
|
32
|
+
|
|
33
|
+
- Use stable manifest ID where applicable. ([#12964](https://github.com/expo/expo/pull/12964) by [@wschurman](https://github.com/wschurman))
|
|
34
|
+
|
|
35
|
+
## 2.2.0 — 2021-06-16
|
|
36
|
+
|
|
37
|
+
### 🐛 Bug fixes
|
|
38
|
+
|
|
39
|
+
- Enable kotlin in all modules. ([#12716](https://github.com/expo/expo/pull/12716) by [@wschurman](https://github.com/wschurman))
|
|
40
|
+
|
|
41
|
+
### 💡 Others
|
|
42
|
+
|
|
43
|
+
- Build Android code using Java 8 to fix Android instrumented test build error. ([#12939](https://github.com/expo/expo/pull/12939) by [@kudo](https://github.com/kudo))
|
|
44
|
+
|
|
11
45
|
## 2.1.0 — 2021-03-10
|
|
12
46
|
|
|
13
47
|
### 🎉 New features
|
package/android/build.gradle
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
apply plugin: '
|
|
2
|
+
apply plugin: 'kotlin-android'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
3
4
|
|
|
4
5
|
group = 'host.exp.exponent'
|
|
5
|
-
version = '
|
|
6
|
+
version = '3.0.1'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
buildscript {
|
|
9
|
+
// Simple helper that allows the root project to override versions declared by this library.
|
|
10
|
+
ext.safeExtGet = { prop, fallback ->
|
|
11
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
repositories {
|
|
15
|
+
mavenCentral()
|
|
16
|
+
}
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
dependencies {
|
|
19
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
// Creating sources with comments
|
|
@@ -20,16 +26,19 @@ task androidSourcesJar(type: Jar) {
|
|
|
20
26
|
from android.sourceSets.main.java.srcDirs
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
afterEvaluate {
|
|
30
|
+
publishing {
|
|
31
|
+
publications {
|
|
32
|
+
release(MavenPublication) {
|
|
33
|
+
from components.release
|
|
34
|
+
// Add additional sourcesJar to artifacts
|
|
35
|
+
artifact(androidSourcesJar)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
repositories {
|
|
39
|
+
maven {
|
|
40
|
+
url = mavenLocal().url
|
|
41
|
+
}
|
|
33
42
|
}
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -37,29 +46,28 @@ uploadArchives {
|
|
|
37
46
|
android {
|
|
38
47
|
compileSdkVersion safeExtGet("compileSdkVersion", 30)
|
|
39
48
|
|
|
49
|
+
compileOptions {
|
|
50
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
51
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
52
|
+
}
|
|
53
|
+
|
|
40
54
|
defaultConfig {
|
|
41
55
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
42
56
|
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
43
57
|
versionCode 8
|
|
44
|
-
versionName '
|
|
58
|
+
versionName '3.0.1'
|
|
45
59
|
}
|
|
46
60
|
lintOptions {
|
|
47
61
|
abortOnError false
|
|
48
62
|
}
|
|
49
63
|
}
|
|
50
64
|
|
|
51
|
-
if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
|
|
52
|
-
apply from: project(":unimodules-core").file("../unimodules-core.gradle")
|
|
53
|
-
} else {
|
|
54
|
-
throw new GradleException(
|
|
55
|
-
'\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
|
|
56
|
-
'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
|
|
57
|
-
}
|
|
58
|
-
|
|
59
65
|
repositories {
|
|
60
66
|
mavenCentral()
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
dependencies {
|
|
64
|
-
|
|
70
|
+
api project(':expo-modules-core')
|
|
71
|
+
|
|
72
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
|
|
65
73
|
}
|
package/ios/UMAppLoader.podspec
CHANGED
|
@@ -10,8 +10,9 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '
|
|
13
|
+
s.platform = :ios, '12.0'
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
|
+
s.static_framework = true
|
|
15
16
|
|
|
16
17
|
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
17
18
|
s.source_files = "#{s.name}/**/*.h"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unimodules-app-loader",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "App loader for background applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"expo-module-scripts": "^2.0.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
|
|
25
25
|
}
|
package/android/src/main/java/org/unimodules/apploader/AppLoaderPackagesProviderInterface.java
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
package org.unimodules.apploader;
|
|
2
|
-
|
|
3
|
-
import java.util.List;
|
|
4
|
-
|
|
5
|
-
import org.unimodules.core.interfaces.Package;
|
|
6
|
-
|
|
7
|
-
public interface AppLoaderPackagesProviderInterface<ReactPackageType> {
|
|
8
|
-
/**
|
|
9
|
-
* Returns a list of React Native packages to load.
|
|
10
|
-
*/
|
|
11
|
-
List<ReactPackageType> getPackages();
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Returns a list of Expo packages to load.
|
|
15
|
-
*/
|
|
16
|
-
List<Package> getExpoPackages();
|
|
17
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
package org.unimodules.apploader;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
import android.content.pm.PackageManager;
|
|
5
|
-
import android.util.Log;
|
|
6
|
-
|
|
7
|
-
import java.util.HashMap;
|
|
8
|
-
import java.util.Map;
|
|
9
|
-
|
|
10
|
-
public class AppLoaderProvider {
|
|
11
|
-
|
|
12
|
-
private static Map<String, HeadlessAppLoader> loaders = new HashMap<>();
|
|
13
|
-
|
|
14
|
-
public static HeadlessAppLoader getLoader(String name, Context context) {
|
|
15
|
-
if (!loaders.containsKey(name)) {
|
|
16
|
-
try {
|
|
17
|
-
createLoader(name, context);
|
|
18
|
-
} catch (Exception e) {
|
|
19
|
-
Log.e("Expo", "Cannot initialize app loader. " + e.getMessage());
|
|
20
|
-
e.printStackTrace();
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return loaders.get(name);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@SuppressWarnings("unchecked")
|
|
28
|
-
private static void createLoader(String name, Context context) throws ClassNotFoundException, IllegalAccessException, InstantiationException, java.lang.reflect.InvocationTargetException, NoSuchMethodException {
|
|
29
|
-
Class<? extends HeadlessAppLoader> loaderClass;
|
|
30
|
-
try {
|
|
31
|
-
String loaderClassName = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA).metaData.getString("org.unimodules.core.AppLoader#" + name);
|
|
32
|
-
if (loaderClassName != null) {
|
|
33
|
-
loaderClass = (Class<? extends HeadlessAppLoader>)Class.forName(loaderClassName);
|
|
34
|
-
loaders.put(name, (HeadlessAppLoader) loaderClass.getDeclaredConstructor(Context.class).newInstance(context));
|
|
35
|
-
} else {
|
|
36
|
-
throw new IllegalStateException("Unable to instantiate AppLoader!");
|
|
37
|
-
}
|
|
38
|
-
} catch (PackageManager.NameNotFoundException e) {
|
|
39
|
-
throw new IllegalStateException("Unable to instantiate AppLoader!", e);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public static abstract class Callback {
|
|
45
|
-
|
|
46
|
-
public void onComplete(boolean success, Exception exception) {
|
|
47
|
-
// nothing
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
package org.unimodules.apploader;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
|
|
5
|
-
import org.unimodules.core.interfaces.Consumer;
|
|
6
|
-
|
|
7
|
-
public interface HeadlessAppLoader {
|
|
8
|
-
|
|
9
|
-
class AppConfigurationError extends Exception {
|
|
10
|
-
|
|
11
|
-
public AppConfigurationError(String message) {
|
|
12
|
-
super(message);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public AppConfigurationError(String message, Exception cause) {
|
|
16
|
-
super(message, cause);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
void loadApp(Context context, Params params, Runnable alreadyRunning, Consumer<Boolean> callback) throws AppConfigurationError;
|
|
21
|
-
|
|
22
|
-
boolean invalidateApp(String appId);
|
|
23
|
-
|
|
24
|
-
boolean isRunning(String appId);
|
|
25
|
-
|
|
26
|
-
final class Params {
|
|
27
|
-
private final String appId;
|
|
28
|
-
private final String appUrl;
|
|
29
|
-
|
|
30
|
-
public Params(String appId, String appUrl) {
|
|
31
|
-
this.appId = appId;
|
|
32
|
-
this.appUrl = appUrl;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public String getAppId() {
|
|
36
|
-
return appId;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public String getAppUrl() {
|
|
40
|
-
return appUrl;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|