diff --git a/CliClient/app/fuzzing.js b/CliClient/app/fuzzing.js index a62c080358..737242e639 100644 --- a/CliClient/app/fuzzing.js +++ b/CliClient/app/fuzzing.js @@ -63,7 +63,7 @@ function randomWord() { function execCommand(client, command, options = {}) { let exePath = 'node ' + joplinAppPath; - let cmd = exePath + ' --profile ' + client.profileDir + ' ' + command; + let cmd = exePath + ' --env dev --profile ' + client.profileDir + ' ' + command; logger.info(client.id + ': ' + command); if (options.killAfter) { @@ -80,7 +80,7 @@ function execCommand(client, command, options = {}) { reject(error); } } else { - resolve(stdout); + resolve(stdout.trim()); } }); diff --git a/CliClient/app/main.js b/CliClient/app/main.js index 6c2f0ac482..3b921d26b2 100644 --- a/CliClient/app/main.js +++ b/CliClient/app/main.js @@ -40,6 +40,7 @@ const packageJson = require('./package.json'); let initArgs = { profileDir: null, + env: 'prod', } const fsDriver = new FsDriverNode(); @@ -821,6 +822,13 @@ async function handleStartFlags(argv) { continue; } + if (arg == '--env') { + if (!nextArg) throw new Error(_('Usage: --env ')); + initArgs.env = nextArg; + argv.splice(0, 2); + continue; + } + if (arg == '--redraw-disabled') { vorpalUtils.setRedrawEnabled(false); argv.splice(0, 1); @@ -913,27 +921,19 @@ async function main() { let argv = process.argv; argv = await handleStartFlags(argv); - if (argv.length) showPromptString = false; const profileDir = initArgs.profileDir ? initArgs.profileDir : os.homedir() + '/.config/' + Setting.value('appName'); const resourceDir = profileDir + '/resources'; - const tempDir = profileDir + '/tmp'; + Setting.setConstant('env', initArgs.env); Setting.setConstant('profileDir', profileDir); Setting.setConstant('resourceDir', resourceDir); - Setting.setConstant('tempDir', tempDir); await fs.mkdirp(profileDir, 0o755); await fs.mkdirp(resourceDir, 0o755); - await fs.mkdirp(tempDir, 0o755); - - // let logDatabase = new Database(new DatabaseDriverNode()); - // await logDatabase.open({ name: profileDir + '/database-log.sqlite' }); - // await logDatabase.exec(Logger.databaseCreateTableSql()); logger.addTarget('file', { path: profileDir + '/log.txt' }); - // logger.addTarget('database', { database: logDatabase, source: 'main' }); logger.setLevel(logLevel); dbLogger.addTarget('file', { path: profileDir + '/log-database.txt' }); @@ -943,6 +943,7 @@ async function main() { syncLogger.setLevel(logLevel); logger.info(sprintf('Starting %s %s...', packageJson.name, packageJson.version)); + logger.info('Environment: ' + Setting.value('env')); logger.info('Profile directory: ' + profileDir); // That's not good, but it's to avoid circular dependency issues @@ -969,7 +970,9 @@ async function main() { // If we still have arguments, pass it to Vorpal and exit if (argv.length) { - vorpal.show(); + //vorpal.delimiter(' AAAAAAAAAAAAAAAAAAAAA'); + //console.info(vorpal.ui.inquirer); + //vorpal.show(); let cmd = shellArgsToString(argv); await vorpal.exec(cmd); await vorpal.exec('exit'); diff --git a/CliClient/run.sh b/CliClient/run.sh index 711d271b74..d98cf29361 100755 --- a/CliClient/run.sh +++ b/CliClient/run.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --redraw-disabled "$@" +bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --redraw-disabled --env dev "$@" #bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes import-enex --fuzzy-matching /home/laurent/Desktop/afaire.enex afaire #bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes import-enex --fuzzy-matching /home/laurent/Desktop/Laurent.enex laurent \ No newline at end of file diff --git a/CliClient/test.txt b/CliClient/test.txt new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/CliClient/test.txt @@ -0,0 +1 @@ +[] diff --git a/ReactNativeClient/android/Feature1024x500.png b/ReactNativeClient/android/Feature1024x500.png new file mode 100644 index 0000000000..674f61ed34 Binary files /dev/null and b/ReactNativeClient/android/Feature1024x500.png differ diff --git a/ReactNativeClient/android/Icon512x512.png b/ReactNativeClient/android/Icon512x512.png new file mode 100644 index 0000000000..e54fdbb8ad Binary files /dev/null and b/ReactNativeClient/android/Icon512x512.png differ diff --git a/ReactNativeClient/android/Screenshot1.png b/ReactNativeClient/android/Screenshot1.png new file mode 100644 index 0000000000..8547a54ae1 Binary files /dev/null and b/ReactNativeClient/android/Screenshot1.png differ diff --git a/ReactNativeClient/android/Screenshot2.png b/ReactNativeClient/android/Screenshot2.png new file mode 100644 index 0000000000..fa5a76f5ba Binary files /dev/null and b/ReactNativeClient/android/Screenshot2.png differ diff --git a/ReactNativeClient/android/app/BUCK b/ReactNativeClient/android/app/BUCK index cf8ab64eea..422f63e26f 100644 --- a/ReactNativeClient/android/app/BUCK +++ b/ReactNativeClient/android/app/BUCK @@ -45,12 +45,12 @@ android_library( android_build_config( name = "build_config", - package = "com.awesomeproject", + package = "net.cozic.joplin", ) android_resource( name = "res", - package = "com.awesomeproject", + package = "net.cozic.joplin", res = "src/main/res", ) diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index b572a55ba7..8dbf280a6b 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -75,7 +75,7 @@ apply from: "../../node_modules/react-native/react.gradle" * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ -def enableSeparateBuildPerCPUArchitecture = false +def enableSeparateBuildPerCPUArchitecture = true /** * Run Proguard to shrink the Java bytecode in release builds. @@ -87,11 +87,11 @@ android { buildToolsVersion "23.0.1" defaultConfig { - applicationId "com.awesomeproject" + applicationId "net.cozic.joplin" minSdkVersion 16 targetSdkVersion 22 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "0.8.0" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ReactNativeClient/android/app/src/main/AndroidManifest.xml b/ReactNativeClient/android/app/src/main/AndroidManifest.xml index 8755241a43..728a660abc 100644 --- a/ReactNativeClient/android/app/src/main/AndroidManifest.xml +++ b/ReactNativeClient/android/app/src/main/AndroidManifest.xml @@ -1,12 +1,14 @@ + xmlns:tools="http://schemas.android.com/tools" + package="net.cozic.joplin" + android:versionCode="2" + android:versionName="0.8.0"> + - AwesomeProject + Joplin diff --git a/ReactNativeClient/android/settings.gradle b/ReactNativeClient/android/settings.gradle index 8eee62ea70..5fe7bbd3fe 100644 --- a/ReactNativeClient/android/settings.gradle +++ b/ReactNativeClient/android/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'AwesomeProject' +rootProject.name = 'Joplin' include ':react-native-fs' project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') diff --git a/ReactNativeClient/app.json b/ReactNativeClient/app.json index fce8324867..113ae74e29 100644 --- a/ReactNativeClient/app.json +++ b/ReactNativeClient/app.json @@ -1,10 +1,10 @@ { - "name": "AwesomeProject", - "displayName": "AwesomeProject", + "name": "Joplin", + "displayName": "Joplin", "expo": { - "name": "AwesomeProject", - "description": "No description", - "slug": "AwesomeProject", + "name": "Joplin", + "description": "Joplin for Android", + "slug": "Joplin", "privacy": "public", "sdkVersion": "18.0.0", "version": "1.0.0", diff --git a/ReactNativeClient/index.ios.js b/ReactNativeClient/index.ios.js index f28f6b33de..addb4dcfa6 100644 --- a/ReactNativeClient/index.ios.js +++ b/ReactNativeClient/index.ios.js @@ -12,7 +12,7 @@ import { View } from 'react-native'; -export default class AwesomeProject extends Component { +export default class Joplin extends Component { render() { return ( @@ -50,4 +50,4 @@ const styles = StyleSheet.create({ }, }); -AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); +AppRegistry.registerComponent('Joplin', () => Joplin); diff --git a/ReactNativeClient/lib/components/screen-header.js b/ReactNativeClient/lib/components/screen-header.js index 883529db0c..7a2b2d6f03 100644 --- a/ReactNativeClient/lib/components/screen-header.js +++ b/ReactNativeClient/lib/components/screen-header.js @@ -94,9 +94,7 @@ ScreenHeaderComponent.defaultProps = { }; const ScreenHeader = connect( - (state) => { - return { user: state.user }; - } + //(state) => {} )(ScreenHeaderComponent) export { ScreenHeader }; \ No newline at end of file diff --git a/ReactNativeClient/lib/components/screens/login.js b/ReactNativeClient/lib/components/screens/login.js deleted file mode 100644 index c0953aeab1..0000000000 --- a/ReactNativeClient/lib/components/screens/login.js +++ /dev/null @@ -1,91 +0,0 @@ -import React, { Component } from 'react'; -import { View, Button, TextInput, Text } from 'react-native'; -import { connect } from 'react-redux' -import { Log } from 'lib/log.js' -import { Setting } from 'lib/models/setting.js'; -import { ScreenHeader } from 'lib/components/screen-header.js'; -import { _ } from 'lib/locale.js'; - -class LoginScreenComponent extends React.Component { - - static navigationOptions(options) { - return { header: null }; - } - - constructor() { - super(); - this.state = { - email: '', - password: '', - errorMessage: null, - }; - } - - componentWillMount() { - this.setState({ email: this.props.user.email }); - } - - email_changeText(text) { - this.setState({ email: text }); - } - - password_changeText(text) { - this.setState({ password: text }); - } - - loginButton_press() { - this.setState({ errorMessage: null }); - - // return Registry.api().post('sessions', null, { - // 'email': this.state.email, - // 'password': this.state.password, - // 'client_id': Setting.value('clientId'), - // }).then((session) => { - // Log.info('Got session', session); - - // let user = { - // email: this.state.email, - // session: session.id, - // }; - // Setting.setObject('user', user); - - // this.props.dispatch({ - // type: 'USER_SET', - // user: user, - // }); - - // this.props.dispatch({ - // type: 'Navigation/BACK', - // }); - - // Registry.api().setSession(session.id); - - // //Registry.synchronizer().start(); - // }).catch((error) => { - // this.setState({ errorMessage: _('Could not login: %s)', error.message) }); - // }); - } - - render() { - return ( - - - this.email_changeText(text)} keyboardType="email-address" /> - this.password_changeText(text)} secureTextEntry={true} /> - { this.state.errorMessage && {this.state.errorMessage} } -