Skip to content

Commit

Permalink
🐛 Fixed ignoredFiles excluded in dist pack
Browse files Browse the repository at this point in the history
  • Loading branch information
giosuetrap2002 committed Jun 29, 2023
1 parent 691c934 commit 9bcecd1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
Empty file modified dist/index.js
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion dist/mobile_app/actions/flutter/flutterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const defaultFlutterApp = () => __awaiter(void 0, void 0, void 0, function* () {
console.log((0, utils_1.blackText)("----------"));
yield (0, utils_1.updateMainActivityAndDirectory)(fileRepository, path.join(selectedFolderAbsolutePath, name), identifier);
console.log((0, utils_1.blackText)("----------"));
yield (0, utils_1.addAndUpdateIgnoredFiles)(fileRepository, path.join(selectedFolderAbsolutePath, name), name);
yield (0, utils_1.addAndUpdateIgnoredFiles)(fileRepository, path.join(selectedFolderAbsolutePath, name), name, identifier);
console.log((0, utils_1.successfulBg)((0, utils_1.whiteText)("Progetto configurato!\n")));
console.log((0, utils_1.blackText)("All\'apertura del progetto dovrai eseguire le seguenti azioni:\n1. flutter pub get"));
}
Expand Down
9 changes: 6 additions & 3 deletions dist/mobile_app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ const updateMainActivityAndDirectory = (fileRepository, appPath, bundleId) => __
yield fileRepository.updateMainActivity(appPath, bundleId);
});
exports.updateMainActivityAndDirectory = updateMainActivityAndDirectory;
const addAndUpdateIgnoredFiles = (fileRepository, appPath, appName) => __awaiter(void 0, void 0, void 0, function* () {
const addAndUpdateIgnoredFiles = (fileRepository, appPath, appName, identifier) => __awaiter(void 0, void 0, void 0, function* () {
const androidIgnoredFilePath = 'android/';
yield addIgnoredFiles(fileRepository, appPath);
yield updateIgnoredFiles(fileRepository, appPath, appName);
yield updateIgnoredFiles(fileRepository, appPath, identifier);
fs.renameSync(path.join(appPath, androidIgnoredFilePath, "flutter_boilerplate_android.iml"), path.join(appPath, androidIgnoredFilePath, appName + "_android.iml"));
fs.renameSync(path.join(appPath, "flutter_revo_boilerplate.iml"), path.join(appPath, appName + ".iml"));
});
Expand All @@ -174,7 +174,7 @@ const addIgnoredFiles = (fileRepository, appPath) => __awaiter(void 0, void 0, v
yield fileRepository.addIgnoredFiles(path.join(appPath, iOSIgnoredFilePath2), "GeneratedPluginRegistrant.m", false);
yield fileRepository.addIgnoredFiles(appPath, "flutter_revo_boilerplate.iml", null);
});
const updateIgnoredFiles = (fileRepository, appPath, appName) => __awaiter(void 0, void 0, void 0, function* () {
const updateIgnoredFiles = (fileRepository, appPath, bundleId) => __awaiter(void 0, void 0, void 0, function* () {
const androidIgnoredFilePath = 'android/';
const iOSIgnoredFilePath1 = 'ios/Flutter/';
const flutterSdk = getFlutterSdk();
Expand All @@ -183,6 +183,9 @@ const updateIgnoredFiles = (fileRepository, appPath, appName) => __awaiter(void
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath, "local.properties"), "flutter.sdk=", "flutter.sdk=" + flutterSdk);
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, iOSIgnoredFilePath1, "flutter_export_environment.sh"), "export \"FLUTTER_ROOT=\"", "export \"FLUTTER_ROOT=" + flutterSdk + "\"");
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, iOSIgnoredFilePath1, "flutter_export_environment.sh"), "export \"FLUTTER_APPLICATION_PATH=\"", "export \"FLUTTER_APPLICATION_PATH=" + appPath + "\"");
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/main/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">");
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/debug/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">");
yield fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/profile/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">");
});
const getFlutterSdk = () => {
const flutterBinPath = (0, child_process_1.execSync)('which flutter').toString().trim();
Expand Down
2 changes: 1 addition & 1 deletion mobile_app/actions/flutter/flutterActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const defaultFlutterApp = async () => {
console.log(blackText("----------"));
await updateMainActivityAndDirectory(fileRepository, path.join(selectedFolderAbsolutePath, name), identifier)
console.log(blackText("----------"));
await addAndUpdateIgnoredFiles(fileRepository, path.join(selectedFolderAbsolutePath, name), name)
await addAndUpdateIgnoredFiles(fileRepository, path.join(selectedFolderAbsolutePath, name), name, identifier)
console.log(successfulBg(whiteText("Progetto configurato!\n")));
console.log(blackText("All\'apertura del progetto dovrai eseguire le seguenti azioni:\n1. flutter pub get"));
} catch (e) {
Expand Down
9 changes: 6 additions & 3 deletions mobile_app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ export const updateMainActivityAndDirectory = async (fileRepository: FileReposit
await fileRepository.updateMainActivity(appPath, bundleId)
}

export const addAndUpdateIgnoredFiles = async (fileRepository: FileRepository, appPath: string, appName) => {
export const addAndUpdateIgnoredFiles = async (fileRepository: FileRepository, appPath: string, appName: string, identifier: string) => {
const androidIgnoredFilePath = 'android/'
await addIgnoredFiles(fileRepository, appPath);
await updateIgnoredFiles(fileRepository, appPath, appName);
await updateIgnoredFiles(fileRepository, appPath, identifier);

fs.renameSync(path.join(appPath, androidIgnoredFilePath, "flutter_boilerplate_android.iml"), path.join(appPath, androidIgnoredFilePath, appName + "_android.iml"));
fs.renameSync(path.join(appPath, "flutter_revo_boilerplate.iml"), path.join(appPath, appName + ".iml"));
Expand All @@ -158,7 +158,7 @@ const addIgnoredFiles = async (fileRepository: FileRepository, appPath: string,)
await fileRepository.addIgnoredFiles(appPath, "flutter_revo_boilerplate.iml", null)
}

const updateIgnoredFiles = async (fileRepository: FileRepository, appPath: string, appName: string) => {
const updateIgnoredFiles = async (fileRepository: FileRepository, appPath: string, bundleId: string) => {
const androidIgnoredFilePath = 'android/'
const iOSIgnoredFilePath1 = 'ios/Flutter/'

Expand All @@ -168,6 +168,9 @@ const updateIgnoredFiles = async (fileRepository: FileRepository, appPath: strin
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath, "local.properties"), "flutter.sdk=", "flutter.sdk=" + flutterSdk)
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, iOSIgnoredFilePath1, "flutter_export_environment.sh"), "export \"FLUTTER_ROOT=\"", "export \"FLUTTER_ROOT=" + flutterSdk + "\"")
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, iOSIgnoredFilePath1, "flutter_export_environment.sh"), "export \"FLUTTER_APPLICATION_PATH=\"", "export \"FLUTTER_APPLICATION_PATH=" + appPath + "\"")
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/main/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">")
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/debug/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">")
await fileRepository.editInformationForIgnoredFiles(path.join(appPath, androidIgnoredFilePath + "app/src/profile/", "AndroidManifest.xml"), "package=\"it.revodigital.flutterboilerplate.flutter_boilerplate\"", "package=\"" + bundleId + "\">")
}

const getFlutterSdk = () => {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"keywords": [],
"author": "",
"license": "ISC",
"files": [
"dist/"
],
"scripts": {
"build": "tsc",
"postbuild": "node postBuildScript.js"
Expand Down
2 changes: 1 addition & 1 deletion postBuildScript.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const fs = require('fs-extra');

fs.copySync('mobile_app/ignoredFiles/', 'dist/mobile_app/ignoredFiles/');
fs.copySync('mobile_app/ignoredFiles/', 'dist/mobile_app/ignoredFiles/');

0 comments on commit 9bcecd1

Please sign in to comment.