@pi-r/android 0.2.10 → 0.2.12
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.
|
@@ -4,6 +4,7 @@ const util_1 = require("@e-mc/document/util");
|
|
|
4
4
|
const types_1 = require("@e-mc/types");
|
|
5
5
|
const Document = require("@e-mc/document");
|
|
6
6
|
function finalize(instance) {
|
|
7
|
+
var _a;
|
|
7
8
|
const config = instance.config;
|
|
8
9
|
const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
|
|
9
10
|
if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !config.namespace) {
|
|
@@ -95,9 +96,9 @@ function finalize(instance) {
|
|
|
95
96
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], 'compose = true');
|
|
96
97
|
}
|
|
97
98
|
else {
|
|
98
|
-
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.
|
|
99
|
+
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.24")}'` });
|
|
99
100
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], "compose true");
|
|
100
|
-
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.
|
|
101
|
+
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.14")}'`, true);
|
|
101
102
|
if (upgrade) {
|
|
102
103
|
output = Document.updateGradle(output, ['android', 'kotlinOptions'], `jvmTarget = '${javaVersion}'`, true);
|
|
103
104
|
}
|
|
@@ -148,7 +149,7 @@ function finalize(instance) {
|
|
|
148
149
|
output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
|
-
if (namespace || (namespace = config.manifest
|
|
152
|
+
if (namespace || (namespace = (_a = config.manifest) === null || _a === void 0 ? void 0 : _a.package)) {
|
|
152
153
|
output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${namespace}"`, true);
|
|
153
154
|
}
|
|
154
155
|
setModified(output);
|
package/extensions/task/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const child_process = require("child_process");
|
|
|
5
5
|
const types_1 = require("@e-mc/types");
|
|
6
6
|
const Document = require("@e-mc/document");
|
|
7
7
|
async function finalize(instance) {
|
|
8
|
+
var _a, _b, _c;
|
|
8
9
|
const commands = instance.config.commands;
|
|
9
10
|
if (!commands || this.incremental === 'staging') {
|
|
10
11
|
return;
|
|
@@ -24,13 +25,13 @@ async function finalize(instance) {
|
|
|
24
25
|
else {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
let { broadcastId, baseDirectory } = this, command = instance.settings.extensions
|
|
28
|
+
let { broadcastId, baseDirectory } = this, command = (_b = (_a = instance.settings.extensions) === null || _a === void 0 ? void 0 : _a.task) === null || _b === void 0 ? void 0 : _b.command, title, name, foundCwd;
|
|
28
29
|
if (command) {
|
|
29
30
|
if (command.indexOf('mvn') !== -1) {
|
|
30
31
|
title = 'maven';
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
|
-
title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)
|
|
34
|
+
title = ((_c = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)) === null || _c === void 0 ? void 0 : _c[1]) || 'SPAWN';
|
|
34
35
|
}
|
|
35
36
|
command = path.normalize(command);
|
|
36
37
|
if (!command.includes(path.sep)) {
|
package/index.js
CHANGED
|
@@ -161,13 +161,14 @@ class AndroidDocument extends Document {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
findTemplate(baseDir, filename, options) {
|
|
164
|
+
var _a;
|
|
164
165
|
let detect, languageOf;
|
|
165
166
|
if (options) {
|
|
166
167
|
({ detect, languageOf } = options);
|
|
167
168
|
}
|
|
168
169
|
let kotlin, language;
|
|
169
170
|
if (languageOf) {
|
|
170
|
-
kotlin = (language = this.settings.language
|
|
171
|
+
kotlin = (language = (_a = this.settings.language) === null || _a === void 0 ? void 0 : _a[languageOf]) === 'kotlin';
|
|
171
172
|
const isKts = this.detectKts(baseDir, filename);
|
|
172
173
|
detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
|
|
173
174
|
if (kotlin) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/android",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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.5.
|
|
24
|
-
"@e-mc/types": "^0.5.
|
|
25
|
-
"htmlparser2": "^9.
|
|
23
|
+
"@e-mc/document": "^0.5.10",
|
|
24
|
+
"@e-mc/types": "^0.5.10",
|
|
25
|
+
"htmlparser2": "^9.1.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -38,7 +38,7 @@ java {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.
|
|
41
|
+
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.24")
|
|
42
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")
|