mirror of
https://github.com/laurent22/joplin.git
synced 2026-06-18 20:16:34 +02:00
Mobile: Reload note when resource got downloaded. Also fixed Android build script to make it work in macOS.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const fs = require('fs-extra');
|
||||
const { execCommand, githubRelease, githubOauthToken } = require('./tool-utils.js');
|
||||
const { execCommand, githubRelease, githubOauthToken, isWindows } = require('./tool-utils.js');
|
||||
const path = require('path');
|
||||
const fetch = require('node-fetch');
|
||||
const uriTemplate = require('uri-template');
|
||||
@@ -60,9 +60,23 @@ async function main() {
|
||||
console.info('Running from: ' + process.cwd());
|
||||
|
||||
console.info('Building APK file...');
|
||||
const output = await execCommand('/mnt/c/Windows/System32/cmd.exe /c "cd ReactNativeClient\\android && gradlew.bat assembleRelease -PbuildDir=build --console plain"');
|
||||
|
||||
let restoreDir = null;
|
||||
let apkBuildCmd = 'assembleRelease -PbuildDir=build --console plain';
|
||||
if (isWindows()) {
|
||||
apkBuildCmd = '/mnt/c/Windows/System32/cmd.exe /c "cd ReactNativeClient\\android && gradlew.bat ' + apkBuildCmd + '"';
|
||||
} else {
|
||||
process.chdir(rnDir + '/android');
|
||||
apkBuildCmd = './gradlew ' + apkBuildCmd;
|
||||
restoreDir = rootDir;
|
||||
}
|
||||
|
||||
// const output = await execCommand('/mnt/c/Windows/System32/cmd.exe /c "cd ReactNativeClient\\android && gradlew.bat assembleRelease -PbuildDir=build --console plain"');
|
||||
const output = await execCommand(apkBuildCmd);
|
||||
console.info(output);
|
||||
|
||||
if (restoreDir) process.chdir(restoreDir);
|
||||
|
||||
await fs.mkdirp(releaseDir);
|
||||
|
||||
console.info('Copying APK to ' + apkFilePath);
|
||||
|
||||
@@ -115,4 +115,16 @@ toolUtils.githubRelease = async function(project, tagName, isDraft) {
|
||||
return responseJson;
|
||||
}
|
||||
|
||||
toolUtils.isLinux = () => {
|
||||
return process && process.platform === 'linux';
|
||||
}
|
||||
|
||||
toolUtils.isWindows = () => {
|
||||
return process && process.platform === 'win32';
|
||||
}
|
||||
|
||||
toolUtils.isMac = () => {
|
||||
return process && process.platform === 'darwin';
|
||||
}
|
||||
|
||||
module.exports = toolUtils;
|
||||
Reference in New Issue
Block a user