From 18ca33858f2b571b8c452ec7769305918379d893 Mon Sep 17 00:00:00 2001 From: Lenar Khannanov <55162739+Come1LLF00@users.noreply.github.com> Date: Sun, 15 Aug 2021 09:15:31 +0300 Subject: [PATCH] Feat 3014 3 enum2string migration and logging and logging-api too (#3157) * feat: completed working build.gradle for enum_to_string logging and logging-api; needed to rename jar and check it content carefully * fix: added logging and logging-api dependencies to resulting jar file * fix: deleted deprecated build.xml --- android/settings.gradle | 6 ++- java_console/logging/build.gradle | 8 +++ java_console/logging/settings.gradle | 2 + java_tools/enum_to_string/build.gradle | 60 +++++++++++++++++++++++ java_tools/enum_to_string/build.xml | 28 ----------- java_tools/enum_to_string/settings.gradle | 4 ++ 6 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 java_console/logging/build.gradle create mode 100644 java_console/logging/settings.gradle create mode 100644 java_tools/enum_to_string/build.gradle delete mode 100644 java_tools/enum_to_string/build.xml create mode 100644 java_tools/enum_to_string/settings.gradle diff --git a/android/settings.gradle b/android/settings.gradle index 4ce930619f..a40262c0b6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -3,6 +3,8 @@ include ':shared_io' project(':shared_io').projectDir = new File('../java_console/shared_io') include ':ecu_io' project(':ecu_io').projectDir = new File('../java_console/io') +include ':logging' +project(':logging').projectDir = new File('../java_console/logging') include ':logging-api' project(':logging-api').projectDir = new File('../java_console/logging-api') include ':inifile' @@ -16,4 +18,6 @@ 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') \ No newline at end of file +project(':version2header').projectDir = new File('../java_tools/version2header') +include ':enum_to_string' +project(':enum_to_string').projectDir = new File('../java_tools/enum_to_string') \ No newline at end of file diff --git a/java_console/logging/build.gradle b/java_console/logging/build.gradle new file mode 100644 index 0000000000..809904318d --- /dev/null +++ b/java_console/logging/build.gradle @@ -0,0 +1,8 @@ +plugins { + id 'java-library' +} + +dependencies { + implementation project(':logging-api') + implementation fileTree(dir: '../lib', include: 'annotations.jar') +} \ No newline at end of file diff --git a/java_console/logging/settings.gradle b/java_console/logging/settings.gradle new file mode 100644 index 0000000000..e2eed5b626 --- /dev/null +++ b/java_console/logging/settings.gradle @@ -0,0 +1,2 @@ +include ':logging-api' +project(':logging-api').projectDir = new File('../logging-api') \ No newline at end of file diff --git a/java_tools/enum_to_string/build.gradle b/java_tools/enum_to_string/build.gradle new file mode 100644 index 0000000000..bd3498abc2 --- /dev/null +++ b/java_tools/enum_to_string/build.gradle @@ -0,0 +1,60 @@ +plugins { + id 'java-library' + id 'com.github.johnrengelman.shadow' version '6.1.0' +} + +repositories { + mavenCentral() +} + +defaultTasks 'shadowJar' + +dependencies { + // https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 + implementation 'com.google.code.findbugs:jsr305:2.0.1' + implementation 'junit:junit:4.8.2' + implementation project(':logging') + implementation project(':logging-api') + implementation fileTree(dir: '../../java_console/lib', include: 'annotations.jar') +} + +/* + don't use it, otherwise + you'll get jar only with + enum_to_string classes + for the full jar with logging* + use shadowJar task +*/ +jar { + archivesBaseName = 'enum2string' + destinationDirectory = file( '$rootDir/../..' ) + manifest { + attributes( + 'Main-Class': 'com.rusefi.EnumToString' + ) + } +} + +shadowJar { + /* + to exclude suffix '-all' + in resulting archive file name + */ + archiveBaseName = 'enum2string' + archiveClassifier = '' + + destinationDirectory = file( '$rootDir/../..' ) + manifest { + inheritFrom project.tasks.jar.manifest + } + + /* + to keep only classes from logging + and loggin-api as in build.xml + */ + dependencies { + exclude(dependency('com.google.code.findbugs:jsr305:.*')) + exclude(dependency('junit:junit:.*')) + exclude 'annotations.jar' + } +} \ No newline at end of file diff --git a/java_tools/enum_to_string/build.xml b/java_tools/enum_to_string/build.xml deleted file mode 100644 index 6494c0d63a..0000000000 --- a/java_tools/enum_to_string/build.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/java_tools/enum_to_string/settings.gradle b/java_tools/enum_to_string/settings.gradle new file mode 100644 index 0000000000..86053a5a25 --- /dev/null +++ b/java_tools/enum_to_string/settings.gradle @@ -0,0 +1,4 @@ +include ':logging' +project(':logging').projectDir = new File('../../java_console/logging') +include ':logging-api' +project(':logging-api').projectDir = new File('../../java_console/logging-api') \ No newline at end of file