@pi-r/android 0.11.3 → 0.12.0
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/data/google-maven-snapshot.json +1 -1
- package/data/google-maven.json +1 -1
- package/extensions/app/manifest/index.js +27 -25
- package/extensions/gradle/dependencies/index.js +144 -163
- package/extensions/gradle/settings/index.js +15 -15
- package/extensions/task/index.js +13 -11
- package/index.js +22 -14
- package/package.json +3 -3
- package/project/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/java/build.gradle +4 -4
- package/template/java/static/build.gradle +2 -2
- package/template/java/static/gradle.properties +1 -0
- package/template/java+kotlin/build.gradle +9 -13
- package/template/java+kotlin/libs.versions.toml +3 -3
- package/template/java+kotlin/settings.gradle +4 -0
- package/template/java+kotlin/static/build.gradle +1 -0
- package/template/java+kotlin/static/gradle.properties +1 -0
- package/template/kotlin/build.gradle.kts +12 -18
- package/template/kotlin/libs.versions.toml +2 -3
- package/template/kotlin/settings.gradle.kts +4 -0
- package/template/kotlin/static/gradle.properties +2 -1
- package/types/index.d.ts +3 -2
- package/types/squared.d.ts +2 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { XmlWriter } = require('@e-mc/document/parse');
|
|
5
|
+
const { getNewline, replaceAll } = require('@e-mc/document/util');
|
|
5
6
|
function finalize(instance) {
|
|
6
7
|
const { dependencies, projectName, mainParentDir } = instance.config;
|
|
7
8
|
if (!dependencies && !projectName) {
|
|
@@ -15,23 +16,21 @@ function finalize(instance) {
|
|
|
15
16
|
if (dependencies) {
|
|
16
17
|
found: {
|
|
17
18
|
const pattern = kotlin ? /^\s*include\(((?:\s*"[^"]+"\s*,?\s*)+)\)/gm : /^\s*include\s*((?:(?:"[^"]+"|'[^']+')\s*,?\s*)+)/gm;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const namespace = /":?([^"]+)"|':?([^']+)'/g;
|
|
21
|
-
while (app = namespace.exec(match[1])) {
|
|
19
|
+
for (const match of source.matchAll(pattern)) {
|
|
20
|
+
for (const app of match[1].matchAll(/":?([^"]+)"|':?([^']+)'/g)) {
|
|
22
21
|
if (app[1] === mainParentDir || app[2] === mainParentDir) {
|
|
23
22
|
break found;
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
if (match
|
|
26
|
+
const match = pattern.exec(source);
|
|
27
|
+
if (match) {
|
|
29
28
|
const index = match.index + match[0].length;
|
|
30
29
|
if (kotlin) {
|
|
31
|
-
source = source.
|
|
30
|
+
source = source.slice(0, index - 1).trimEnd() + `, "${mainParentDir}")` + source.slice(index);
|
|
32
31
|
}
|
|
33
32
|
else {
|
|
34
|
-
source =
|
|
33
|
+
source = XmlWriter.replaceMatch(match, source, `, '${mainParentDir}'`, { trimLeading: true });
|
|
35
34
|
}
|
|
36
35
|
modified = true;
|
|
37
36
|
}
|
|
@@ -39,18 +38,18 @@ function finalize(instance) {
|
|
|
39
38
|
}
|
|
40
39
|
if (targetName) {
|
|
41
40
|
const value = `rootProject.name = "${targetName}"`;
|
|
42
|
-
const match = new RegExp('^\\s*rootProject\\.name\\s*=\\s*' +
|
|
41
|
+
const match = new RegExp('^\\s*rootProject\\.name\\s*=\\s*' + XmlWriter.PATTERN_QUOTEVALUE, 'm').exec(source);
|
|
43
42
|
if (match) {
|
|
44
|
-
source =
|
|
43
|
+
source = XmlWriter.replaceMatch(match, source, value);
|
|
45
44
|
}
|
|
46
45
|
else {
|
|
47
|
-
source +=
|
|
46
|
+
source += getNewline(source) + value;
|
|
48
47
|
}
|
|
49
48
|
modified = true;
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
53
|
-
source =
|
|
52
|
+
source = replaceAll(source, (name) => {
|
|
54
53
|
switch (name) {
|
|
55
54
|
case 'projectName':
|
|
56
55
|
return targetName || '';
|
|
@@ -76,4 +75,5 @@ function finalize(instance) {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
}
|
|
78
|
+
|
|
79
79
|
module.exports = finalize;
|
package/extensions/task/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const child_process = require('node:child_process');
|
|
6
|
+
const which = require('which');
|
|
7
|
+
const Document = require('@e-mc/document');
|
|
8
|
+
const { createAbortError, errorValue, isArray, isPlainObject, sanitizeArgs, sanitizeCmd } = require('@e-mc/types');
|
|
8
9
|
const checkWin32 = (value) => value === "gradlew" && Document.PLATFORM_WIN32 ? value + '.bat' : value;
|
|
9
10
|
async function finalize(instance) {
|
|
10
11
|
const commands = instance.config.commands;
|
|
@@ -15,7 +16,7 @@ async function finalize(instance) {
|
|
|
15
16
|
if (typeof commands === 'string') {
|
|
16
17
|
taskArgs = [[commands]];
|
|
17
18
|
}
|
|
18
|
-
else if (
|
|
19
|
+
else if (isArray(commands)) {
|
|
19
20
|
if (commands.every(value => typeof value === 'string')) {
|
|
20
21
|
taskArgs = [commands];
|
|
21
22
|
}
|
|
@@ -70,7 +71,7 @@ async function finalize(instance) {
|
|
|
70
71
|
catch {
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
if (
|
|
74
|
+
if (isPlainObject(exec)) {
|
|
74
75
|
let { uid: u, gid: g } = exec;
|
|
75
76
|
if ((u = parseInt(u)) >= 0) {
|
|
76
77
|
uid = u;
|
|
@@ -81,14 +82,14 @@ async function finalize(instance) {
|
|
|
81
82
|
}
|
|
82
83
|
for (const args of taskArgs) {
|
|
83
84
|
if (instance.aborted) {
|
|
84
|
-
return
|
|
85
|
+
return createAbortError(true);
|
|
85
86
|
}
|
|
86
87
|
const startTime = process.hrtime();
|
|
87
88
|
const task = args.join(' ');
|
|
88
89
|
await new Promise((resolve, reject) => {
|
|
89
90
|
this.formatMessage(4, title, ['Executing task...', task], baseDirectory);
|
|
90
91
|
let out = '', message = '';
|
|
91
|
-
const { stdout, stderr } = child_process.spawn(
|
|
92
|
+
const { stdout, stderr } = child_process.spawn(sanitizeCmd(command, sanitizeArgs(args)), { cwd: baseDirectory, shell: true, stdio: Document.hasLogType(32768) && !broadcastId ? 'inherit' : undefined, signal: instance.signal, uid, gid })
|
|
92
93
|
.on('exit', code => {
|
|
93
94
|
if (!code) {
|
|
94
95
|
instance.addLog(4, out);
|
|
@@ -96,7 +97,7 @@ async function finalize(instance) {
|
|
|
96
97
|
resolve();
|
|
97
98
|
}
|
|
98
99
|
else {
|
|
99
|
-
reject(
|
|
100
|
+
reject(errorValue(message || (!foundDir && code === 1 ? "Unable to execute file" : "Unknown"), "Error code" + ': ' + code));
|
|
100
101
|
}
|
|
101
102
|
})
|
|
102
103
|
.on('error', reject);
|
|
@@ -118,4 +119,5 @@ async function finalize(instance) {
|
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
121
|
}
|
|
122
|
+
|
|
121
123
|
module.exports = finalize;
|
package/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { asExt, createAbortError, errorValue, isArray, isPlainObject } = require('@e-mc/types');
|
|
5
6
|
const Document = require('@e-mc/document');
|
|
6
7
|
const kAndroid = Symbol.for('android:constructor');
|
|
7
8
|
const sanitizePath = (value) => Document.PLATFORM_WIN32 ? value.replace(/^\.?[\\/]+/, '').replace(/[\\/]+$/, '') : value.replace(/^\.?\/+/, '').replace(/\/+$/, '');
|
|
@@ -9,7 +10,7 @@ class AndroidDocument extends Document {
|
|
|
9
10
|
static [kAndroid] = true;
|
|
10
11
|
static async finalize(instance) {
|
|
11
12
|
if (instance.aborted) {
|
|
12
|
-
return
|
|
13
|
+
return createAbortError(true);
|
|
13
14
|
}
|
|
14
15
|
if (instance.extensions.length > 0) {
|
|
15
16
|
const config = instance.config;
|
|
@@ -56,12 +57,14 @@ class AndroidDocument extends Document {
|
|
|
56
57
|
elements = [];
|
|
57
58
|
extensionData = {};
|
|
58
59
|
targetAPI;
|
|
60
|
+
resolutionScreenWidth;
|
|
61
|
+
resolutionScreenHeight;
|
|
59
62
|
directories;
|
|
60
63
|
_moduleName = 'android';
|
|
61
64
|
_threadable = true;
|
|
62
65
|
init(assets, config) {
|
|
63
66
|
if (config) {
|
|
64
|
-
const { targetAPI, mainParentDir, mainSrcDir, mainActivityFile, javaVersion, jvmToolchain, projectName, versionName, versionCode = 0, manifest, namespace, applicationId, profileable, dependencies, dependencyScopes, versionCatalog, libraries, dataBinding, commands, directories, elements, extensionData } = config;
|
|
67
|
+
const { targetAPI, resolutionScreenWidth = 0, resolutionScreenHeight = 0, mainParentDir, mainSrcDir, mainActivityFile, javaVersion, jvmToolchain, projectName, versionName, versionCode = 0, manifest, namespace, applicationId, profileable, dependencies, dependencyScopes, versionCatalog, libraries, dataBinding, commands, directories, elements, extensionData } = config;
|
|
65
68
|
const target = this.config;
|
|
66
69
|
if (projectName) {
|
|
67
70
|
target.projectName = projectName;
|
|
@@ -96,7 +99,7 @@ class AndroidDocument extends Document {
|
|
|
96
99
|
if (dataBinding) {
|
|
97
100
|
target.dataBinding = true;
|
|
98
101
|
}
|
|
99
|
-
if (
|
|
102
|
+
if (isPlainObject(manifest)) {
|
|
100
103
|
target.manifest = manifest;
|
|
101
104
|
}
|
|
102
105
|
if (profileable !== undefined) {
|
|
@@ -111,22 +114,26 @@ class AndroidDocument extends Document {
|
|
|
111
114
|
if (javaVersion) {
|
|
112
115
|
target.javaVersion = typeof javaVersion === 'string' ? +javaVersion.replace(/_/g, '.') : javaVersion;
|
|
113
116
|
}
|
|
114
|
-
if (
|
|
117
|
+
if (isArray(dependencies)) {
|
|
115
118
|
target.dependencies = dependencies;
|
|
116
119
|
}
|
|
117
|
-
if (
|
|
120
|
+
if (isPlainObject(libraries) && Object.keys(libraries).length > 0) {
|
|
118
121
|
target.libraries = libraries;
|
|
119
122
|
}
|
|
120
123
|
if (targetAPI) {
|
|
121
124
|
this.targetAPI = targetAPI;
|
|
122
125
|
}
|
|
123
|
-
if (
|
|
126
|
+
if (resolutionScreenWidth > 0 && resolutionScreenHeight > 0) {
|
|
127
|
+
this.resolutionScreenWidth = resolutionScreenWidth;
|
|
128
|
+
this.resolutionScreenHeight = resolutionScreenHeight;
|
|
129
|
+
}
|
|
130
|
+
if (isPlainObject(directories)) {
|
|
124
131
|
this.directories = directories;
|
|
125
132
|
}
|
|
126
|
-
if (
|
|
133
|
+
if (isArray(elements)) {
|
|
127
134
|
this.elements = elements;
|
|
128
135
|
}
|
|
129
|
-
if (
|
|
136
|
+
if (isPlainObject(extensionData)) {
|
|
130
137
|
this.extensionData = extensionData;
|
|
131
138
|
}
|
|
132
139
|
}
|
|
@@ -152,7 +159,7 @@ class AndroidDocument extends Document {
|
|
|
152
159
|
}
|
|
153
160
|
async using(data) {
|
|
154
161
|
if (this.aborted) {
|
|
155
|
-
return
|
|
162
|
+
return createAbortError(true);
|
|
156
163
|
}
|
|
157
164
|
const { host, file } = data;
|
|
158
165
|
const localUri = file.localUri;
|
|
@@ -225,7 +232,7 @@ class AndroidDocument extends Document {
|
|
|
225
232
|
paths.push(filename);
|
|
226
233
|
let uri;
|
|
227
234
|
if (!existing && !(uri = this.resolveDir('template', ...paths))) {
|
|
228
|
-
throw
|
|
235
|
+
throw errorValue("File not found", uri);
|
|
229
236
|
}
|
|
230
237
|
return { localUri, source: fs.readFileSync(uri || localUri, 'utf8'), existing, kotlin, language };
|
|
231
238
|
}
|
|
@@ -251,7 +258,7 @@ class AndroidDocument extends Document {
|
|
|
251
258
|
let localUri;
|
|
252
259
|
try {
|
|
253
260
|
if (localUri = this.resolveDir('data', filename)) {
|
|
254
|
-
return this.tryParse(fs.readFileSync(localUri, 'utf8'), format ||
|
|
261
|
+
return this.tryParse(fs.readFileSync(localUri, 'utf8'), format || asExt(localUri));
|
|
255
262
|
}
|
|
256
263
|
}
|
|
257
264
|
catch (err) {
|
|
@@ -286,4 +293,5 @@ class AndroidDocument extends Document {
|
|
|
286
293
|
return this.module.settings ||= {};
|
|
287
294
|
}
|
|
288
295
|
}
|
|
296
|
+
|
|
289
297
|
module.exports = AndroidDocument;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/android",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Android document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/document": "^0.
|
|
24
|
-
"@e-mc/types": "^0.
|
|
23
|
+
"@e-mc/document": "^0.14.0",
|
|
24
|
+
"@e-mc/types": "^0.14.0",
|
|
25
25
|
"dom-serializer": "^2.0.0",
|
|
26
26
|
"domhandler": "^5.0.3",
|
|
27
27
|
"domutils": "^3.2.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
@@ -4,12 +4,12 @@ plugins {
|
|
|
4
4
|
|
|
5
5
|
android {
|
|
6
6
|
namespace = ''
|
|
7
|
-
compileSdk =
|
|
7
|
+
compileSdk = 37
|
|
8
8
|
|
|
9
9
|
defaultConfig {
|
|
10
10
|
applicationId ''
|
|
11
|
-
minSdk =
|
|
12
|
-
targetSdk =
|
|
11
|
+
minSdk = 26
|
|
12
|
+
targetSdk = 37
|
|
13
13
|
versionCode 1
|
|
14
14
|
versionName '1.0'
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
debuggable false
|
|
21
21
|
minifyEnabled true
|
|
22
22
|
shrinkResources = false
|
|
23
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
23
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
compileOptions {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
-
|
|
3
1
|
plugins {
|
|
4
2
|
alias libs.plugins.android.application
|
|
5
|
-
alias libs.plugins.kotlin.
|
|
3
|
+
alias libs.plugins.kotlin.compose
|
|
6
4
|
}
|
|
7
5
|
|
|
8
6
|
android {
|
|
9
7
|
namespace = ''
|
|
10
|
-
compileSdk
|
|
8
|
+
compileSdk {
|
|
9
|
+
version = release(37) {
|
|
10
|
+
minorApiLevel = 0
|
|
11
|
+
}
|
|
12
|
+
}
|
|
11
13
|
|
|
12
14
|
defaultConfig {
|
|
13
15
|
applicationId ''
|
|
14
|
-
minSdk =
|
|
15
|
-
targetSdk =
|
|
16
|
+
minSdk = 26
|
|
17
|
+
targetSdk = 37
|
|
16
18
|
versionCode 1
|
|
17
19
|
versionName '1.0'
|
|
18
20
|
|
|
@@ -23,7 +25,7 @@ android {
|
|
|
23
25
|
debuggable false
|
|
24
26
|
minifyEnabled true
|
|
25
27
|
shrinkResources = false
|
|
26
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
28
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
compileOptions {
|
|
@@ -38,12 +40,6 @@ android {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
kotlin {
|
|
42
|
-
compilerOptions {
|
|
43
|
-
jvmTarget = JvmTarget.fromTarget('11')
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
43
|
dependencies {
|
|
48
44
|
implementation libs.androidx.core.ktx
|
|
49
45
|
testImplementation libs.junit
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[versions]
|
|
2
|
-
agp = "
|
|
3
|
-
kotlin = "2.2.21"
|
|
2
|
+
agp = "9.2.0"
|
|
4
3
|
coreKtx = "1.18.0"
|
|
4
|
+
kotlin = "2.3.21"
|
|
5
5
|
junit = "4.13.2"
|
|
6
6
|
junitVersion = "1.3.0"
|
|
7
7
|
espressoCore = "3.7.0"
|
|
@@ -14,4 +14,4 @@ androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-co
|
|
|
14
14
|
|
|
15
15
|
[plugins]
|
|
16
16
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
|
17
|
-
kotlin-
|
|
17
|
+
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
-
|
|
3
1
|
plugins {
|
|
4
2
|
alias(libs.plugins.android.application)
|
|
5
|
-
alias(libs.plugins.kotlin.android)
|
|
6
3
|
alias(libs.plugins.kotlin.compose)
|
|
7
4
|
}
|
|
8
5
|
|
|
9
6
|
android {
|
|
10
7
|
namespace = ""
|
|
11
|
-
compileSdk
|
|
8
|
+
compileSdk {
|
|
9
|
+
version = release(37) {
|
|
10
|
+
minorApiLevel = 0
|
|
11
|
+
}
|
|
12
|
+
}
|
|
12
13
|
|
|
13
14
|
defaultConfig {
|
|
14
15
|
applicationId = ""
|
|
15
|
-
minSdk =
|
|
16
|
-
targetSdk =
|
|
16
|
+
minSdk = 26
|
|
17
|
+
targetSdk = 37
|
|
17
18
|
versionCode = 1
|
|
18
19
|
versionName = "1.0"
|
|
19
20
|
|
|
@@ -24,9 +25,13 @@ android {
|
|
|
24
25
|
isDebuggable = false
|
|
25
26
|
isMinifyEnabled = true
|
|
26
27
|
isShrinkResources = false
|
|
27
|
-
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
28
|
+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
compileOptions {
|
|
32
|
+
sourceCompatibility = JavaVersion.VERSION_11
|
|
33
|
+
targetCompatibility = JavaVersion.VERSION_11
|
|
34
|
+
}
|
|
30
35
|
buildFeatures {
|
|
31
36
|
viewBinding = true
|
|
32
37
|
}
|
|
@@ -35,17 +40,6 @@ android {
|
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
java {
|
|
39
|
-
sourceCompatibility = JavaVersion.VERSION_11
|
|
40
|
-
targetCompatibility = JavaVersion.VERSION_11
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
kotlin {
|
|
44
|
-
compilerOptions {
|
|
45
|
-
jvmTarget = JvmTarget.fromTarget("11")
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
43
|
dependencies {
|
|
50
44
|
implementation(libs.jetbrains.kotlin)
|
|
51
45
|
implementation(libs.androidx.core.ktx)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[versions]
|
|
2
|
-
agp = "
|
|
3
|
-
kotlin = "2.2.21"
|
|
2
|
+
agp = "9.2.0"
|
|
4
3
|
coreKtx = "1.18.0"
|
|
4
|
+
kotlin = "2.3.21"
|
|
5
5
|
junit = "4.13.2"
|
|
6
6
|
junitVersion = "1.3.0"
|
|
7
7
|
espressoCore = "3.7.0"
|
|
@@ -21,5 +21,4 @@ android-material = { group = "com.google.android.material", name = "material", v
|
|
|
21
21
|
|
|
22
22
|
[plugins]
|
|
23
23
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
|
24
|
-
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|
25
24
|
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
@@ -9,8 +9,9 @@ org.gradle.configuration-cache=true
|
|
|
9
9
|
# org.gradle.warning.mode=summary
|
|
10
10
|
|
|
11
11
|
android.useAndroidX=true
|
|
12
|
+
android.nonTransitiveRClass=true
|
|
12
13
|
# android.nonFinalResIds=true
|
|
13
|
-
# android.nonTransitiveRClass=true
|
|
14
14
|
# android.enableR8.fullMode=true
|
|
15
|
+
# android.r8.optimizedResource=true
|
|
15
16
|
|
|
16
17
|
kotlin.code.style=official
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentConstructor, IDocument, IFileManager } from '@e-mc/types/lib';
|
|
2
|
-
import type { ExternalAsset } from '@e-mc/types/lib/asset';
|
|
2
|
+
import type { ExternalAsset, IFileThread } from '@e-mc/types/lib/asset';
|
|
3
3
|
import type { ExecAction, DocumentDirectory as IDocumentDirectory, DocumentModule as IDocumentModule, DocumentSettings as IDocumentSettings } from '@e-mc/types/lib/settings';
|
|
4
4
|
|
|
5
5
|
import type { DependencyScopes, DocumentOutput, FinalizedElement } from './squared';
|
|
@@ -21,7 +21,7 @@ interface AndroidDocumentSettings extends Pick<IDocumentSettings, "users" | "dir
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type DocumentProperties = "targetAPI" | "elements" | "extensionData" | "directories";
|
|
24
|
+
type DocumentProperties = "targetAPI" | "resolutionScreenWidth" | "resolutionScreenHeight" | "elements" | "extensionData" | "directories";
|
|
25
25
|
|
|
26
26
|
export interface UserConfig extends Omit<DocumentOutput, DocumentProperties> {
|
|
27
27
|
mainParentDir: string;
|
|
@@ -66,6 +66,7 @@ export interface IAndroidDocument<T extends IFileManager<U>, U extends DocumentA
|
|
|
66
66
|
config: UserConfig;
|
|
67
67
|
elements: FinalizedElement[];
|
|
68
68
|
extensionData: PlainObject;
|
|
69
|
+
using(data: IFileThread): Promise<void>;
|
|
69
70
|
writeTemplate(data: TemplateData, host?: T): void;
|
|
70
71
|
findTemplate(baseDir: string, filename: string, options?: FindTemplateOptions): TemplateData;
|
|
71
72
|
findData<V = AnyObject>(filename: string, format?: string): V | null;
|
package/types/squared.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface CssConditionData extends ConditionProperty {
|
|
|
31
31
|
|
|
32
32
|
export interface DocumentOutput {
|
|
33
33
|
targetAPI?: number | string;
|
|
34
|
+
resolutionScreenWidth?: number;
|
|
35
|
+
resolutionScreenHeight?: number;
|
|
34
36
|
manifest?: ManifestData;
|
|
35
37
|
namespace?: string;
|
|
36
38
|
applicationId?: string;
|