@pi-r/android 0.2.10 → 0.2.11

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) {
@@ -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?.package)) {
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);
@@ -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?.task?.command, title, name, foundCwd;
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)?.[1] || 'SPAWN';
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?.[languageOf]) === 'kotlin';
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.10",
3
+ "version": "0.2.11",
4
4
  "description": "Android document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {