1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Tools: Refactor Android release script

This commit is contained in:
Laurent Cozic
2020-11-06 18:45:45 +00:00
parent 7e2d512fde
commit 7ea4f570cb
9 changed files with 104 additions and 19 deletions

View File

@@ -61,3 +61,4 @@ buck-out/
# Custom
lib/csstojs/
lib/rnInjectedJs/
dist/

View File

@@ -138,8 +138,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097602
versionName "1.4.0"
versionCode 2097608
versionName "1.4.6"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}

View File

@@ -11,6 +11,7 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit

View File

@@ -12,6 +12,9 @@ const tasks = {
podInstall: {
fn: require('./tools/podInstall'),
},
prepareRelease: {
fn: require('./tools/prepareRelease'),
},
// clean: {
// fn: require('./tools/clean'),
// },

View File

@@ -16,7 +16,6 @@
"dependencies": {
"@joplinapp/lib": "^1.0.9",
"@joplinapp/renderer": "^1.0.17",
"@joplinapp/tools": "^1.0.9",
"@react-native-community/clipboard": "^1.5.0",
"@react-native-community/datetimepicker": "^3.0.3",
"@react-native-community/geolocation": "^2.0.2",
@@ -60,6 +59,7 @@
"valid-url": "^1.0.9"
},
"devDependencies": {
"@joplinapp/tools": "^1.0.9",
"@babel/core": "^7.11.6",
"@babel/runtime": "^7.11.2",
"@types/node": "^14.14.6",

View File

@@ -0,0 +1,32 @@
// This is to replace the symlinks inside node_modules with the actual packages
// as I assumed it was needed to build the final release. However it seems
// Android `assembleRelease` handles symlinks properly so maybe this is not
// needed after all ¯\_(ツ)_/¯
const { copyDir } = require('@joplinapp/tools/gulp/utils');
const { rootDir, deleteLink, toSystemSlashes } = require('@joplinapp/tools/tool-utils');
const mobileDir = `${rootDir}/packages/app-mobile`;
module.exports = async function() {
const dirsToCopy = [
'fork-htmlparser2',
'fork-sax',
'lib',
'renderer',
];
const destDir = `${mobileDir}/node_modules/@joplinapp`;
for (const dir of dirsToCopy) {
const destPath = toSystemSlashes(`${destDir}/${dir}`);
const sourcePath = toSystemSlashes(`${rootDir}/packages/${dir}`);
console.info(`Copying ${sourcePath} => ${destPath}`);
// TODO: copy symlink so that it can be restored
await deleteLink(destPath);
await copyDir(sourcePath, destPath, {
excluded: ['node_modules'],
});
}
};