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
This commit is contained in:
Lenar Khannanov 2021-08-15 09:15:31 +03:00 committed by GitHub
parent 231fd6bed8
commit 18ca33858f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 29 deletions

View File

@ -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')
project(':version2header').projectDir = new File('../java_tools/version2header')
include ':enum_to_string'
project(':enum_to_string').projectDir = new File('../java_tools/enum_to_string')

View File

@ -0,0 +1,8 @@
plugins {
id 'java-library'
}
dependencies {
implementation project(':logging-api')
implementation fileTree(dir: '../lib', include: 'annotations.jar')
}

View File

@ -0,0 +1,2 @@
include ':logging-api'
project(':logging-api').projectDir = new File('../logging-api')

View File

@ -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'
}
}

View File

@ -1,28 +0,0 @@
<project default="jar">
<property name="console_path" value="../../java_console"/>
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" classpath="${console_path}/lib/jsr305-2.0.1.jar:${console_path}/lib/junit.jar:${console_path}/lib/annotations.jar">
<src path="src/main/java"/>
<src path="${console_path}/logging-api/src/main/java"/>
<src path="${console_path}/logging/src/main/java"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../enum2string.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.EnumToString"/>
</manifest>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
</project>

View File

@ -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')