mirror of https://github.com/rusefi/rusefi.git
let's separate Android from not Android
This commit is contained in:
parent
28e671622a
commit
f8b7470c7b
|
@ -49,7 +49,6 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':ecu_io')
|
implementation project(':ecu_io')
|
||||||
implementation project(':autoupdate')
|
|
||||||
implementation project(':logging-api')
|
implementation project(':logging-api')
|
||||||
implementation project(':shared_io')
|
implementation project(':shared_io')
|
||||||
implementation project(':models')
|
implementation project(':models')
|
||||||
|
|
|
@ -13,21 +13,3 @@ include ':inifile'
|
||||||
project(':inifile').projectDir = new File('../java_console/inifile')
|
project(':inifile').projectDir = new File('../java_console/inifile')
|
||||||
include ':models'
|
include ':models'
|
||||||
project(':models').projectDir = new File('../java_console/models')
|
project(':models').projectDir = new File('../java_console/models')
|
||||||
include ':autoupdate'
|
|
||||||
project(':autoupdate').projectDir = new File('../java_console/autoupdate')
|
|
||||||
include ':gcc_map_reader'
|
|
||||||
project(':gcc_map_reader').projectDir = new File('../java_tools/gcc_map_reader')
|
|
||||||
include ':logicdata2c'
|
|
||||||
project(':logicdata2c').projectDir = new File('../java_tools/logicdata2c')
|
|
||||||
include ':version2header'
|
|
||||||
project(':version2header').projectDir = new File('../java_tools/version2header')
|
|
||||||
include ':enum_to_string'
|
|
||||||
project(':enum_to_string').projectDir = new File('../java_tools/enum_to_string')
|
|
||||||
include ':bin2header'
|
|
||||||
project(':bin2header').projectDir = new File('../java_tools/bin2header')
|
|
||||||
include ':config_definition'
|
|
||||||
project(':config_definition').projectDir = new File('../java_tools/configuration_definition')
|
|
||||||
include ':ts_plugin_launcher'
|
|
||||||
project(':ts_plugin_launcher').projectDir = new File('../java_tools/ts_plugin_launcher')
|
|
||||||
include ':ts_plugin'
|
|
||||||
project(':ts_plugin').projectDir = new File('../java_tools/ts_plugin')
|
|
||||||
|
|
|
@ -2,10 +2,8 @@ package com.rusefi.autoupdate;
|
||||||
|
|
||||||
import com.rusefi.shared.ConnectionAndMeta;
|
import com.rusefi.shared.ConnectionAndMeta;
|
||||||
import com.rusefi.shared.FileUtil;
|
import com.rusefi.shared.FileUtil;
|
||||||
import com.rusefi.ui.storage.PersistentConfiguration;
|
import com.rusefi.preferences.storage.PersistentConfiguration;
|
||||||
import com.rusefi.ui.util.FrameHelper;
|
import com.rusefi.ui.util.FrameHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -22,13 +20,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class Autoupdate {
|
public class Autoupdate {
|
||||||
private static final String TITLE = "rusEFI Bundle Updater 20220717";
|
private static final String TITLE = "rusEFI Bundle Updater 20220717";
|
||||||
private static final String BUNDLE_NAME_FILE = "../bundle_name.txt";
|
|
||||||
private static final String AUTOUPDATE_MODE = "autoupdate";
|
private static final String AUTOUPDATE_MODE = "autoupdate";
|
||||||
private static final String RUSEFI_CONSOLE_JAR = "rusefi_console.jar";
|
private static final String RUSEFI_CONSOLE_JAR = "rusefi_console.jar";
|
||||||
private static final String COM_RUSEFI_LAUNCHER = "com.rusefi.Launcher";
|
private static final String COM_RUSEFI_LAUNCHER = "com.rusefi.Launcher";
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String bundleFullName = readBundleFullName();
|
String bundleFullName = BundleUtil.readBundleFullName();
|
||||||
|
|
||||||
if (args.length > 0 && args[0].equalsIgnoreCase("release")) {
|
if (args.length > 0 && args[0].equalsIgnoreCase("release")) {
|
||||||
System.out.println("Release update requested");
|
System.out.println("Release update requested");
|
||||||
|
@ -198,31 +195,6 @@ public class Autoupdate {
|
||||||
return doUpdate.get();
|
return doUpdate.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return null in case of error
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public static String readBundleFullName() {
|
|
||||||
try {
|
|
||||||
BufferedReader r = new BufferedReader(new FileReader(BUNDLE_NAME_FILE));
|
|
||||||
String fullName = r.readLine();
|
|
||||||
fullName = fullName.trim();
|
|
||||||
if (fullName.length() < 3)
|
|
||||||
return null; // just paranoia check
|
|
||||||
return fullName;
|
|
||||||
} catch (IOException e) {
|
|
||||||
System.err.println(new Date() + ": Error reading " + BUNDLE_NAME_FILE);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static String readBundleFullNameNotNull() {
|
|
||||||
String bundle = readBundleFullName();
|
|
||||||
bundle = bundle == null ? "unknown bundle" : bundle;
|
|
||||||
return bundle;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum UpdateMode {
|
enum UpdateMode {
|
||||||
ALWAYS,
|
ALWAYS,
|
||||||
NEVER,
|
NEVER,
|
||||||
|
|
|
@ -15,7 +15,6 @@ tasks.withType(Test) {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.javaxJson
|
implementation libs.javaxJson
|
||||||
api project(':autoupdate')
|
|
||||||
api project(':models')
|
api project(':models')
|
||||||
api project(':shared_io')
|
api project(':shared_io')
|
||||||
api project(':logging')
|
api project(':logging')
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.io;
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.RusEfiSignature;
|
import com.rusefi.RusEfiSignature;
|
||||||
import com.rusefi.SignatureHelper;
|
import com.rusefi.SignatureHelper;
|
||||||
import com.rusefi.autoupdate.Autoupdate;
|
import com.rusefi.autoupdate.BundleUtil;
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import com.rusefi.ui.StatusConsumer;
|
import com.rusefi.ui.StatusConsumer;
|
||||||
|
@ -32,7 +32,7 @@ public class DfuHelper {
|
||||||
|
|
||||||
public static boolean sendDfuRebootCommand(JComponent parent, String signature, IoStream stream, StatusConsumer messages) {
|
public static boolean sendDfuRebootCommand(JComponent parent, String signature, IoStream stream, StatusConsumer messages) {
|
||||||
RusEfiSignature s = SignatureHelper.parse(signature);
|
RusEfiSignature s = SignatureHelper.parse(signature);
|
||||||
String bundleName = Autoupdate.readBundleFullName();
|
String bundleName = BundleUtil.readBundleFullName();
|
||||||
if (bundleName != null && s != null) {
|
if (bundleName != null && s != null) {
|
||||||
String signatureWithPrefix;
|
String signatureWithPrefix;
|
||||||
if ("all".equals(s.getBundle())) {
|
if ("all".equals(s.getBundle())) {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package com.rusefi.tools;
|
package com.rusefi.tools;
|
||||||
|
|
||||||
import com.rusefi.server.SessionDetails;
|
import com.rusefi.server.SessionDetails;
|
||||||
import com.rusefi.ui.storage.Node;
|
import com.rusefi.preferences.storage.Node;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
import static com.rusefi.preferences.storage.PersistentConfiguration.getConfig;
|
||||||
|
|
||||||
public class VehicleToken {
|
public class VehicleToken {
|
||||||
private static final String VEHICLE_TOKEN = "VEHICLE_TOKEN";
|
private static final String VEHICLE_TOKEN = "VEHICLE_TOKEN";
|
||||||
|
|
|
@ -5,7 +5,6 @@ plugins {
|
||||||
apply from: '../../android/dependencies.gradle'
|
apply from: '../../android/dependencies.gradle'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':autoupdate')
|
|
||||||
api project(':inifile')
|
api project(':inifile')
|
||||||
api libs.snakeyaml
|
api libs.snakeyaml
|
||||||
}
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.rusefi.autoupdate;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class BundleUtil {
|
||||||
|
private static final String BUNDLE_NAME_FILE = "../bundle_name.txt";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return null in case of error
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public static String readBundleFullName() {
|
||||||
|
try {
|
||||||
|
BufferedReader r = new BufferedReader(new FileReader(BUNDLE_NAME_FILE));
|
||||||
|
String fullName = r.readLine();
|
||||||
|
fullName = fullName.trim();
|
||||||
|
if (fullName.length() < 3)
|
||||||
|
return null; // just paranoia check
|
||||||
|
return fullName;
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println(new Date() + ": Error reading " + BUNDLE_NAME_FILE);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static String readBundleFullNameNotNull() {
|
||||||
|
String bundle = readBundleFullName();
|
||||||
|
bundle = bundle == null ? "unknown bundle" : bundle;
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.rusefi.ui.storage;
|
package com.rusefi.preferences.storage;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.rusefi.ui.storage;
|
package com.rusefi.preferences.storage;
|
||||||
|
|
||||||
import com.rusefi.shared.FileUtil;
|
import com.rusefi.shared.FileUtil;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.ui;
|
||||||
|
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.auth.AuthTokenUtil;
|
import com.rusefi.auth.AuthTokenUtil;
|
||||||
import com.rusefi.ui.storage.PersistentConfiguration;
|
import com.rusefi.preferences.storage.PersistentConfiguration;
|
||||||
import com.rusefi.ui.util.URLLabel;
|
import com.rusefi.ui.util.URLLabel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.awt.datatransfer.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
import static com.rusefi.preferences.storage.PersistentConfiguration.getConfig;
|
||||||
|
|
||||||
public class AuthTokenPanel {
|
public class AuthTokenPanel {
|
||||||
private final static Logging log = Logging.getLogging(AuthTokenPanel.class);
|
private final static Logging log = Logging.getLogging(AuthTokenPanel.class);
|
||||||
|
|
|
@ -37,7 +37,7 @@ import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
import static com.rusefi.preferences.storage.PersistentConfiguration.getConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* remote ECU access & control
|
* remote ECU access & control
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi.ts_plugin;
|
package com.rusefi.ts_plugin;
|
||||||
|
|
||||||
import com.rusefi.tools.online.UploadResult;
|
import com.rusefi.tools.online.UploadResult;
|
||||||
import com.rusefi.ui.storage.PersistentConfiguration;
|
import com.rusefi.preferences.storage.PersistentConfiguration;
|
||||||
import org.putgemin.VerticalFlowLayout;
|
import org.putgemin.VerticalFlowLayout;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
Loading…
Reference in New Issue