@pi-r/android 0.3.2 → 0.3.4
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/LICENSE +1 -1
- package/README.md +1 -1
- package/extensions/app/manifest/index.js +1 -6
- package/extensions/gradle/dependencies/index.js +5 -9
- package/extensions/gradle/settings/index.js +3 -8
- package/extensions/task/index.js +4 -8
- package/index.js +3 -7
- package/package.json +3 -3
- package/template/java/static/build.gradle +2 -2
- package/template/java+kotlin/build.gradle +1 -1
- package/template/java+kotlin/static/build.gradle +3 -3
- package/template/kotlin/build.gradle.kts +2 -2
- package/template/kotlin/static/build.gradle.kts +3 -3
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2024 An Pham
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
const path = require("path");
|
|
4
3
|
const htmlparser2 = require("htmlparser2");
|
|
5
4
|
const domhandler = require("domhandler");
|
|
@@ -179,9 +178,5 @@ function finalize(instance) {
|
|
|
179
178
|
}
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
|
-
exports.default = finalize;
|
|
183
181
|
|
|
184
|
-
|
|
185
|
-
module.exports = exports.default;
|
|
186
|
-
module.exports.default = exports.default;
|
|
187
|
-
}
|
|
182
|
+
module.exports = finalize;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
const path = require("path");
|
|
4
3
|
const util_1 = require("@e-mc/document/util");
|
|
5
4
|
const types_1 = require("@e-mc/types");
|
|
6
5
|
const Document = require("@e-mc/document");
|
|
7
6
|
function finalize(instance) {
|
|
7
|
+
var _a;
|
|
8
8
|
const config = instance.config;
|
|
9
9
|
const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
|
|
10
10
|
if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !config.namespace) {
|
|
@@ -97,9 +97,9 @@ function finalize(instance) {
|
|
|
97
97
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], 'compose = true');
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
|
-
output = Document.updateGradle(output, ['plugins'], "id 'org.jetbrains.kotlin.android'", { upgrade: true, multiple: true, addendum: `version '${instance.findVersion('org.jetbrains.kotlin:kotlin-stdlib', "1.9.
|
|
100
|
+
output = Document.updateGradle(output, ['plugins'], "id 'org.jetbrains.kotlin.android'", { upgrade: true, multiple: true, addendum: `version '${instance.findVersion('org.jetbrains.kotlin:kotlin-stdlib', "1.9.22")}'` });
|
|
101
101
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], "compose true");
|
|
102
|
-
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.
|
|
102
|
+
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.9")}'`, true);
|
|
103
103
|
if (upgrade) {
|
|
104
104
|
output = Document.updateGradle(output, ['android', 'kotlinOptions'], `jvmTarget = '${javaVersion}'`, true);
|
|
105
105
|
}
|
|
@@ -150,7 +150,7 @@ function finalize(instance) {
|
|
|
150
150
|
output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
if (namespace || (namespace = config.manifest
|
|
153
|
+
if (namespace || (namespace = (_a = config.manifest) === null || _a === void 0 ? void 0 : _a.package)) {
|
|
154
154
|
output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${namespace}"`, true);
|
|
155
155
|
}
|
|
156
156
|
setModified(output);
|
|
@@ -215,9 +215,5 @@ function finalize(instance) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
exports.default = finalize;
|
|
219
218
|
|
|
220
|
-
|
|
221
|
-
module.exports = exports.default;
|
|
222
|
-
module.exports.default = exports.default;
|
|
223
|
-
}
|
|
219
|
+
module.exports = finalize;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
const path = require("path");
|
|
4
3
|
const util_1 = require("@e-mc/document/util");
|
|
5
4
|
const parse_1 = require("@e-mc/document/parse");
|
|
@@ -10,7 +9,7 @@ function finalize(instance) {
|
|
|
10
9
|
}
|
|
11
10
|
let { localUri, source, existing, kotlin } = instance.findTemplate(this.baseDirectory, 'settings.gradle', { detect: this.incremental !== 'staging', languageOf: 'gradle' });
|
|
12
11
|
if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
|
|
13
|
-
let targetName = projectName
|
|
12
|
+
let targetName = projectName === null || projectName === void 0 ? void 0 : projectName.replace(/"/g, '\\"'), modified;
|
|
14
13
|
if (existing) {
|
|
15
14
|
let match;
|
|
16
15
|
if (dependencies) {
|
|
@@ -50,7 +49,7 @@ function finalize(instance) {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
53
|
-
if (!targetName && (targetName = manifest
|
|
52
|
+
if (!targetName && (targetName = manifest === null || manifest === void 0 ? void 0 : manifest.package)) {
|
|
54
53
|
const index = targetName.lastIndexOf('.');
|
|
55
54
|
targetName = index !== -1 ? targetName.substring(index + 1) : '';
|
|
56
55
|
}
|
|
@@ -77,9 +76,5 @@ function finalize(instance) {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
exports.default = finalize;
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
module.exports = exports.default;
|
|
84
|
-
module.exports.default = exports.default;
|
|
85
|
-
}
|
|
80
|
+
module.exports = finalize;
|
package/extensions/task/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
const path = require("path");
|
|
4
3
|
const fs = require("fs");
|
|
5
4
|
const child_process = require("child_process");
|
|
6
5
|
const types_1 = require("@e-mc/types");
|
|
7
6
|
const Document = require("@e-mc/document");
|
|
8
7
|
async function finalize(instance) {
|
|
8
|
+
var _a, _b;
|
|
9
9
|
const commands = instance.config.commands;
|
|
10
10
|
if (!commands || this.incremental === 'staging') {
|
|
11
11
|
return;
|
|
@@ -25,7 +25,7 @@ async function finalize(instance) {
|
|
|
25
25
|
else {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const settings = instance.settings.extensions
|
|
28
|
+
const settings = ((_a = instance.settings.extensions) === null || _a === void 0 ? void 0 : _a.task) || {};
|
|
29
29
|
const exec = settings.exec;
|
|
30
30
|
let { broadcastId, baseDirectory } = this, command = settings.command, uid, gid, title, name, foundCwd;
|
|
31
31
|
if (command) {
|
|
@@ -33,7 +33,7 @@ async function finalize(instance) {
|
|
|
33
33
|
title = 'maven';
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)
|
|
36
|
+
title = ((_b = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)) === null || _b === void 0 ? void 0 : _b[1]) || 'SPAWN';
|
|
37
37
|
}
|
|
38
38
|
command = path.normalize(command);
|
|
39
39
|
if (!command.includes(path.sep)) {
|
|
@@ -113,9 +113,5 @@ async function finalize(instance) {
|
|
|
113
113
|
.catch(err => instance.writeFail(["Unable to perform task", command + ' ' + task], err, { type: 4, startTime }));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
exports.default = finalize;
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
module.exports = exports.default;
|
|
120
|
-
module.exports.default = exports.default;
|
|
121
|
-
}
|
|
117
|
+
module.exports = finalize;
|
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
const fs = require("fs");
|
|
4
3
|
const path = require("path");
|
|
5
4
|
const types_1 = require("@e-mc/types");
|
|
@@ -162,13 +161,14 @@ class AndroidDocument extends Document {
|
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
163
|
findTemplate(baseDir, filename, options) {
|
|
164
|
+
var _a;
|
|
165
165
|
let detect, languageOf, subDir;
|
|
166
166
|
if (options) {
|
|
167
167
|
({ detect, languageOf, subDir } = options);
|
|
168
168
|
}
|
|
169
169
|
let kotlin, language;
|
|
170
170
|
if (languageOf) {
|
|
171
|
-
kotlin = (language = this.settings.language
|
|
171
|
+
kotlin = (language = (_a = this.settings.language) === null || _a === void 0 ? void 0 : _a[languageOf]) === 'kotlin';
|
|
172
172
|
const isKts = this.detectKts(baseDir, filename);
|
|
173
173
|
detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
|
|
174
174
|
if (kotlin) {
|
|
@@ -216,9 +216,5 @@ class AndroidDocument extends Document {
|
|
|
216
216
|
return (_a = this.module).settings || (_a.settings = {});
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
exports.default = AndroidDocument;
|
|
220
219
|
|
|
221
|
-
|
|
222
|
-
module.exports = exports.default;
|
|
223
|
-
module.exports.default = exports.default;
|
|
224
|
-
}
|
|
220
|
+
module.exports = AndroidDocument;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/android",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Android document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -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.6.
|
|
24
|
-
"@e-mc/types": "^0.6.
|
|
23
|
+
"@e-mc/document": "^0.6.3",
|
|
24
|
+
"@e-mc/types": "^0.6.3",
|
|
25
25
|
"htmlparser2": "^9.0.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -37,7 +37,7 @@ android {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
dependencies {
|
|
40
|
-
implementation 'androidx.core:core-ktx:1.
|
|
40
|
+
implementation 'androidx.core:core-ktx:1.12.0'
|
|
41
41
|
testImplementation 'junit:junit:4.13.2'
|
|
42
42
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
43
43
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
plugins {
|
|
2
|
-
id 'com.android.application' version '8.
|
|
3
|
-
id 'com.android.library' version '8.
|
|
4
|
-
id 'org.jetbrains.kotlin.android' version '1.9.
|
|
2
|
+
id 'com.android.application' version '8.2.0' apply false
|
|
3
|
+
id 'com.android.library' version '8.2.0' apply false
|
|
4
|
+
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
|
|
5
5
|
}
|
|
@@ -38,8 +38,8 @@ java {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.
|
|
42
|
-
implementation("androidx.core:core-ktx:1.
|
|
41
|
+
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
|
|
42
|
+
implementation("androidx.core:core-ktx:1.12.0")
|
|
43
43
|
testImplementation("junit:junit:4.13.2")
|
|
44
44
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
45
45
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
plugins {
|
|
2
|
-
id("com.android.application") version "8.
|
|
3
|
-
id("com.android.library") version "8.
|
|
4
|
-
id("org.jetbrains.kotlin.android") version "1.9.
|
|
2
|
+
id("com.android.application") version "8.2.0" apply false
|
|
3
|
+
id("com.android.library") version "8.2.0" apply false
|
|
4
|
+
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
|
|
5
5
|
}
|