@pi-r/android 0.6.5 → 0.6.6
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 +2 -4
- package/extensions/gradle/dependencies/index.js +11 -11
- package/extensions/gradle/settings/index.js +8 -10
- package/extensions/task/index.js +2 -4
- package/index.js +0 -1
- package/package.json +3 -3
- package/template/java/static/build.gradle +2 -2
- package/template/java+kotlin/static/build.gradle +3 -3
- package/template/kotlin/build.gradle.kts +1 -1
- package/template/kotlin/static/build.gradle.kts +3 -3
|
@@ -8,7 +8,7 @@ const util_1 = require("@e-mc/document/util");
|
|
|
8
8
|
const types_1 = require("@e-mc/types");
|
|
9
9
|
const Parser = htmlparser2.Parser;
|
|
10
10
|
const DomHandler = domhandler.DomHandler;
|
|
11
|
-
function finalize(instance) {
|
|
11
|
+
module.exports = function finalize(instance) {
|
|
12
12
|
const config = instance.config;
|
|
13
13
|
if (!config.manifest) {
|
|
14
14
|
return;
|
|
@@ -176,6 +176,4 @@ function finalize(instance) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
module.exports = finalize;
|
|
179
|
+
};
|
|
@@ -27,16 +27,17 @@ function isUpgrade(version, pending) {
|
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
|
-
function finalize(instance) {
|
|
30
|
+
module.exports = function finalize(instance) {
|
|
31
31
|
const config = instance.config;
|
|
32
|
-
const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
|
|
33
|
-
if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !
|
|
32
|
+
const { profileable, dependencies, dataBinding, versionName, versionCode, namespace } = config;
|
|
33
|
+
if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !namespace) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
const detect = this.incremental !== 'staging';
|
|
37
37
|
let { localUri, source, existing, kotlin } = instance.findTemplate(path.join(this.baseDirectory, config.mainParentDir), "build.gradle", { detect, languageOf: 'gradle' });
|
|
38
38
|
if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
|
|
39
|
-
|
|
39
|
+
const { javaVersion, dependencyScopes } = config;
|
|
40
|
+
let jvmTarget, modified;
|
|
40
41
|
const upgrade = javaVersion > 0;
|
|
41
42
|
const setModified = (output) => {
|
|
42
43
|
if (output !== source) {
|
|
@@ -263,9 +264,9 @@ function finalize(instance) {
|
|
|
263
264
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], 'compose = true');
|
|
264
265
|
}
|
|
265
266
|
else {
|
|
266
|
-
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.
|
|
267
|
+
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.23")}'` });
|
|
267
268
|
output = Document.updateGradle(output, ['android', 'buildFeatures'], "compose true");
|
|
268
|
-
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.
|
|
269
|
+
output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.5.11")}'`, true);
|
|
269
270
|
if (upgrade) {
|
|
270
271
|
output = Document.updateGradle(output, ['android', 'kotlinOptions'], `jvmTarget = '${javaVersion}'`, true);
|
|
271
272
|
}
|
|
@@ -316,8 +317,9 @@ function finalize(instance) {
|
|
|
316
317
|
output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
|
-
|
|
320
|
-
|
|
320
|
+
const applicationId = config.manifest?.package;
|
|
321
|
+
if (applicationId) {
|
|
322
|
+
output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${applicationId}"`, true);
|
|
321
323
|
}
|
|
322
324
|
setModified(output);
|
|
323
325
|
}
|
|
@@ -380,6 +382,4 @@ function finalize(instance) {
|
|
|
380
382
|
}
|
|
381
383
|
}
|
|
382
384
|
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
module.exports = finalize;
|
|
385
|
+
};
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const util_1 = require("@e-mc/document/util");
|
|
4
4
|
const parse_1 = require("@e-mc/document/parse");
|
|
5
|
-
function finalize(instance) {
|
|
6
|
-
const { dependencies, projectName,
|
|
5
|
+
module.exports = function finalize(instance) {
|
|
6
|
+
const { dependencies, projectName, mainParentDir } = instance.config;
|
|
7
7
|
if (!dependencies && !projectName) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
let { localUri, source, existing, kotlin } = instance.findTemplate(this.baseDirectory, "settings.gradle", { detect: this.incremental !== 'staging', languageOf: 'gradle' });
|
|
11
11
|
if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
|
|
12
|
-
|
|
12
|
+
const targetName = projectName?.replace(/"/g, '\\"');
|
|
13
|
+
let modified;
|
|
13
14
|
if (existing) {
|
|
14
15
|
let match;
|
|
15
16
|
if (dependencies) {
|
|
@@ -49,10 +50,6 @@ function finalize(instance) {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
|
-
if (!targetName && (targetName = manifest?.package)) {
|
|
53
|
-
const index = targetName.lastIndexOf('.');
|
|
54
|
-
targetName = index !== -1 ? targetName.substring(index + 1) : '';
|
|
55
|
-
}
|
|
56
53
|
source = (0, util_1.replaceAll)(source, (name) => {
|
|
57
54
|
switch (name) {
|
|
58
55
|
case 'projectName':
|
|
@@ -63,6 +60,9 @@ function finalize(instance) {
|
|
|
63
60
|
return '';
|
|
64
61
|
}
|
|
65
62
|
});
|
|
63
|
+
if (!targetName) {
|
|
64
|
+
source = source.replace(/rootProject\.name = ["']{2}[\r\n]*/, '');
|
|
65
|
+
}
|
|
66
66
|
}
|
|
67
67
|
if (modified || !existing) {
|
|
68
68
|
try {
|
|
@@ -75,6 +75,4 @@ function finalize(instance) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
module.exports = finalize;
|
|
78
|
+
};
|
package/extensions/task/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const which = require("which");
|
|
|
6
6
|
const types_1 = require("@e-mc/types");
|
|
7
7
|
const Document = require("@e-mc/document");
|
|
8
8
|
const checkWin32 = (value) => value === "gradlew" && process.platform === 'win32' ? value + '.bat' : value;
|
|
9
|
-
async function finalize(instance) {
|
|
9
|
+
module.exports = async function finalize(instance) {
|
|
10
10
|
const commands = instance.config.commands;
|
|
11
11
|
if (!commands || this.incremental === 'staging') {
|
|
12
12
|
return;
|
|
@@ -119,6 +119,4 @@ async function finalize(instance) {
|
|
|
119
119
|
})
|
|
120
120
|
.catch(err => instance.writeFail(["Unable to perform task", command + ' ' + task], err, { type: 4, startTime }));
|
|
121
121
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
module.exports = finalize;
|
|
122
|
+
};
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/android",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
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.8.
|
|
24
|
-
"@e-mc/types": "^0.8.
|
|
23
|
+
"@e-mc/document": "^0.8.7",
|
|
24
|
+
"@e-mc/types": "^0.8.7",
|
|
25
25
|
"htmlparser2": "^9.1.0",
|
|
26
26
|
"which": "^2.0.2"
|
|
27
27
|
}
|
|
@@ -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.3.0' apply false
|
|
3
|
+
id 'com.android.library' version '8.3.0' apply false
|
|
4
|
+
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
|
|
5
5
|
}
|
|
@@ -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.23")
|
|
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")
|
|
@@ -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.3.0" apply false
|
|
3
|
+
id("com.android.library") version "8.3.0" apply false
|
|
4
|
+
id("org.jetbrains.kotlin.android") version "1.9.23" apply false
|
|
5
5
|
}
|