@tokamakdev/platform-android-arm64 0.1.1-beta.70 → 0.1.1-beta.72

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.
@@ -6,12 +6,13 @@ if [[ $# -ne 3 || $1 != build ]]; then
6
6
  exit 2
7
7
  fi
8
8
 
9
+ # The CLI runs the entrypoint from the pack root.
10
+ pack=$PWD
9
11
  input=$2
10
12
  output=$3
11
13
  metadata=$input/metadata
12
14
  app_name=$(cat "$metadata/app-name")
13
15
  host=$(cat "$metadata/host")
14
- platform=$(cat "$metadata/platform")
15
16
  identifier=$(cat "$metadata/identifier")
16
17
  version=1.0
17
18
  if [[ -f "$metadata/version" ]]; then
@@ -21,14 +22,8 @@ dev_endpoint=
21
22
  dev_session_token=
22
23
  if [[ -f "$metadata/dev-endpoint" ]]; then
23
24
  dev_endpoint=$(cat "$metadata/dev-endpoint")
24
- fi
25
- if [[ -f "$metadata/dev-session-token" ]]; then
26
25
  dev_session_token=$(cat "$metadata/dev-session-token")
27
26
  fi
28
- if [[ -n "$dev_endpoint" && -z "$dev_session_token" ]] || [[ -z "$dev_endpoint" && -n "$dev_session_token" ]]; then
29
- echo "development endpoint and session token must be provided together" >&2
30
- exit 1
31
- fi
32
27
  # Development builds are debug builds. Other builds are release builds,
33
28
  # which R8 shrinks and a configured keystore signs; without one, the debug
34
29
  # key signs them so they install for testing. Gradle reads the keystore
@@ -62,6 +57,11 @@ if [[ -n "${TOKAMAK_ANDROID_MANIFEST:-}" ]]; then
62
57
  exit 1
63
58
  fi
64
59
  fi
60
+ icon=${TOKAMAK_ANDROID_ICON:-}
61
+ if [[ -n "$icon" && ! -d "$icon" ]]; then
62
+ echo "android.icon must be an Android res directory: $icon" >&2
63
+ exit 1
64
+ fi
65
65
  project=$(dirname "$output")/.tokamak
66
66
  app=$project/app
67
67
  native=$app/src/main/jniLibs/arm64-v8a
@@ -69,9 +69,8 @@ assets=$app/src/main/assets/app
69
69
  kotlin=$app/src/main/kotlin/com/tokamak/runtime
70
70
  plugin_api=$project/tokamak-plugin
71
71
  plugin_modules=$project/plugins
72
- icons=$input/icons/$platform
73
72
  # The oldest Android API level the app supports.
74
- min_sdk=31
73
+ min_sdk=$(<"$pack/build/min-sdk")
75
74
 
76
75
  # The Android NDK's compiler, which links the runtime into the app.
77
76
  android_linker() {
@@ -95,7 +94,7 @@ android_linker() {
95
94
  # Link the runtime into libtokamak.so, exporting the JNI functions and the
96
95
  # entry points of the runtime parts the app links.
97
96
  link_runtime() {
98
- local runtime=$input/runtime/TokamakRuntime
97
+ local runtime=$pack/lib/TokamakRuntime
99
98
  local exports=$project/tokamak-exports.map
100
99
  local compiler libraries
101
100
  compiler=$(android_linker)
@@ -146,8 +145,8 @@ rm -rf "$app/src/main/assets" "$app/src/main/jniLibs" "$app/src/main/kotlin" "$a
146
145
  mkdir -p "$native" "$assets" "$kotlin" "$app/src/main/res" "$plugin_api/src/main/kotlin"
147
146
  cp -R "$input/app/." "$assets/"
148
147
  link_runtime
149
- cp -R "$input/native-shell/app/." "$kotlin/"
150
- cp -R "$input/native-shell/plugin/." "$plugin_api/src/main/kotlin/"
148
+ cp -R "$pack/native-shell/app/." "$kotlin/"
149
+ cp -R "$pack/native-shell/plugin/." "$plugin_api/src/main/kotlin/"
151
150
  cat > "$plugin_api/build.gradle" <<'EOF'
152
151
  plugins {
153
152
  id 'com.android.library'
@@ -160,8 +159,8 @@ android {
160
159
  EOF
161
160
 
162
161
  has_icon=false
163
- if [[ -d "$icons" ]]; then
164
- cp -R "$icons/." "$app/src/main/res/"
162
+ if [[ -n "$icon" ]]; then
163
+ cp -R "$icon/." "$app/src/main/res/"
165
164
  shopt -s nullglob
166
165
  launcher_resources=("$app/src/main/res"/mipmap*/ic_launcher.*)
167
166
  if (( ${#launcher_resources[@]} == 0 )); then
@@ -295,7 +294,7 @@ android {
295
294
  minSdk $min_sdk
296
295
  targetSdk 35
297
296
  versionCode 1
298
- versionName '$version'
297
+ versionName providers.gradleProperty('tokamak.version').get()
299
298
  }
300
299
 
301
300
  androidResources {
@@ -380,6 +379,6 @@ manifest=$app/src/main/AndroidManifest.xml
380
379
  # R8 keeps every name, so class names in errors and stack traces stay real.
381
380
  printf '%s\n' '-dontobfuscate' > "$app/tokamak-rules.pro"
382
381
 
383
- gradle --no-daemon ":app:lint$task" ":app:assemble$task" --project-dir "$project"
382
+ gradle --no-daemon "-Ptokamak.version=$version" ":app:lint$task" ":app:assemble$task" --project-dir "$project"
384
383
  mkdir -p "$(dirname "$output")"
385
384
  cp "$app/build/outputs/apk/$variant/app-$variant.apk" "$output"
@@ -0,0 +1 @@
1
+ 31
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/android-arm64/lib/TokamakRuntime/libtokamak.a
3
- size: 35083712 bytes
4
- sha256: 13dcc6cf33f124508edea37c86bc194eabf1f3577062b8a3b5f7466904787987
3
+ size: 34986724 bytes
4
+ sha256: 50e7505cc78993bbf82b915a59ef24b69d057063b91037c1133b677117c1cf68
@@ -10,10 +10,6 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
10
10
 
11
11
  fun restoreGateway(): Int = nativeRestoreGateway(handle)
12
12
 
13
- fun suspend() = nativeSuspend(handle)
14
-
15
- fun resume() = nativeResume(handle)
16
-
17
13
  /**
18
14
  * Posts the JSON [body] to the Worker's `/tokamak/<name>` endpoint, retrying a failed post,
19
15
  * blocking until it responds 200 or [timeoutMillis] passes, and returns the response body.
@@ -79,12 +75,6 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
79
75
  @JvmStatic
80
76
  private external fun nativeRestoreGateway(handle: Long): Int
81
77
 
82
- @JvmStatic
83
- private external fun nativeSuspend(handle: Long)
84
-
85
- @JvmStatic
86
- private external fun nativeResume(handle: Long)
87
-
88
78
  @JvmStatic
89
79
  private external fun nativeCall(
90
80
  handle: Long,
@@ -1,19 +1,6 @@
1
1
  {
2
2
  "tokamakVersion": "0.1.1",
3
3
  "target": "android-arm64",
4
- "artifacts": [
5
- {
6
- "kind": "runtimeLibrary",
7
- "path": "lib/TokamakRuntime"
8
- },
9
- {
10
- "kind": "nativeShellDirectory",
11
- "path": "native-shell"
12
- }
13
- ],
14
- "requiredTools": [
15
- "gradle"
16
- ],
17
4
  "variables": {
18
5
  "key-alias": {
19
6
  "kind": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokamakdev/platform-android-arm64",
3
- "version": "0.1.1-beta.70",
3
+ "version": "0.1.1-beta.72",
4
4
  "description": "The tokamak platform pack for android-arm64",
5
5
  "repository": {
6
6
  "type": "git",