diff --git a/android/dependencies.gradle b/android/dependencies.gradle index 2dd8da5064..71534f85b7 100644 --- a/android/dependencies.gradle +++ b/android/dependencies.gradle @@ -1,7 +1,17 @@ -ext.libs = [ - junit : "junit:junit:4.13", - annotations: "org.jetbrains:annotations:16.0.1", - javaxJson : "javax.json:javax.json-api:1.1.4", - snakeyaml : "org.yaml:snakeyaml:1.26", - jsr305 : "com.google.code.findbugs:jsr305:3.0.2" -] \ No newline at end of file +ext { + libs = [ + junit : "junit:junit:4.13", + annotations : "org.jetbrains:annotations:16.0.1", + javaxJson : "javax.json:javax.json-api:1.1.4", + snakeyaml : "org.yaml:snakeyaml:1.26", + jsr305 : "com.google.code.findbugs:jsr305:3.0.2", + commons_logging: "commons-logging:commons-logging:1.2" + ] + + ts_plugin_libs = [ + httpclient : "org.apache.httpcomponents:httpclient:4.5.12", + httpcore : "org.apache.httpcomponents:httpcore:4.4.13", + httpmime : "org.apache.httpcomponents:httpmime:4.5.12", + launcher_api: fileTree( dir: "lib", include: "TunerStudioPluginAPI.jar" ) + ] +} \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 812c162c94..f4c61b3212 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -22,4 +22,6 @@ 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') \ No newline at end of file +project(':bin2header').projectDir = new File('../java_tools/bin2header') +include ':ts_plugin_launcher' +project(':ts_plugin_launcher').projectDir = new File('../java_tools/ts_plugin_launcher') \ No newline at end of file diff --git a/java_tools/ts_plugin/build.xml b/java_tools/ts_plugin/build.xml index 7f25bea787..149f38351a 100644 --- a/java_tools/ts_plugin/build.xml +++ b/java_tools/ts_plugin/build.xml @@ -36,7 +36,7 @@ - + diff --git a/java_tools/ts_plugin_launcher/build.gradle b/java_tools/ts_plugin_launcher/build.gradle new file mode 100644 index 0000000000..e949622590 --- /dev/null +++ b/java_tools/ts_plugin_launcher/build.gradle @@ -0,0 +1,71 @@ +plugins { + id 'java-library' + id 'com.github.johnrengelman.shadow' version '6.1.0' +} + +defaultTasks 'shadowJar' + +apply from: '../../android/dependencies.gradle' + +dependencies { + testImplementation libs.junit + implementation libs.annotations + implementation ts_plugin_libs.httpcore + implementation ts_plugin_libs.httpmime + implementation ts_plugin_libs.httpclient + // to automatically exclude transitive dependencies of these projects + shadow project(':autoupdate') + shadow project(':shared_io') + implementation ts_plugin_libs.launcher_api + implementation libs.commons_logging +} + +def TODAY = new Date().format('yyyy-MM-dd HH:mm:ss') +def jarName = 'rusefi_ts_plugin_launcher' +def jarDir = 'jar' +def localPath = '.efianalytics/TunerStudio/plugins' +def userHome = System.properties['user.home'] + +jar { + archiveBaseName = jarName + + manifest { + attributes( + 'Built-Date': TODAY, + 'Signature-Vendor': 'rusEFI LLC', + 'ApplicationPlugin': 'com.rusefi.ts_plugin.TsPluginLauncher' + ) + } +} + +shadowJar { + /* + to exclude suffix '-all' + in resulting archive file name + */ + archiveBaseName = jarName + archiveClassifier = '' + + destinationDirectory = file( 'build' + '/' + jarDir ) + manifest { + inheritFrom project.tasks.jar.manifest + } + + /* + to keep only required + dependencies in resulting jar + */ + dependencies { + exclude(dependency(libs.junit)) + exclude(dependency(libs.annotations)) + exclude(dependency(ts_plugin_libs.launcher_api)) + } +} + + +// custom task from build.xml +tasks.register('launcher_local_install', Copy) { + dependsOn tasks.shadowJar + from layout.buildDirectory.dir( jarDir + '/' + jarName + '.jar') + into layout.buildDirectory.dir(userHome + '/' + localPath) +} diff --git a/java_tools/ts_plugin_launcher/build.xml b/java_tools/ts_plugin_launcher/build.xml deleted file mode 100644 index 1535e2e35e..0000000000 --- a/java_tools/ts_plugin_launcher/build.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/java_tools/ts_plugin_launcher/resources/rusefi_online_color_300.png b/java_tools/ts_plugin_launcher/src/main/resources/rusefi_online_color_300.png similarity index 100% rename from java_tools/ts_plugin_launcher/resources/rusefi_online_color_300.png rename to java_tools/ts_plugin_launcher/src/main/resources/rusefi_online_color_300.png