From a0447298d3add97fe5dc8e8c22efc3fe59c2cf85 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sun, 27 May 2018 23:43:35 -0400 Subject: [PATCH] Fix inter-project dependency and including libs into algorithm jar. --- core/c/build.gradle | 18 +++++++-------- core/java/algorithm/build.gradle | 22 ++++++++++--------- .../masterpassword/impl/MPAlgorithmV0.java | 2 +- platform-independent/gui-java/build.gradle | 7 +++--- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/core/c/build.gradle b/core/c/build.gradle index 324332c7..ccceef1c 100644 --- a/core/c/build.gradle +++ b/core/c/build.gradle @@ -8,14 +8,14 @@ plugins { description = 'Master Password Algorithm Implementation' -task archive( type: Zip ) { - dependsOn assemble - - components.withType( ComponentWithRuntimeFile ) { - if (isOptimized()) { - from getRuntimeFile() - into standardOperatingSystem( linkTask.get().targetPlatform.get() ) + '/' + - standardArchitecture( linkTask.get().targetPlatform.get() ) +artifacts { + 'default' task( type: Zip, "archive" ) { + components.withType( ComponentWithRuntimeFile ) { + if (isOptimized()) { + from getRuntimeFile() + into standardOperatingSystem( linkTask.get().targetPlatform.get() ) + '/' + + standardArchitecture( linkTask.get().targetPlatform.get() ) + } } } } @@ -34,7 +34,6 @@ library { } } components.withType( CppComponent ) { - // Reconfigure the toolchain from C++ to C. cppSource.from fileTree( dir: "src", include: "**/*.c" ) } @@ -43,6 +42,7 @@ library { objects.named( OperatingSystemFamily, OperatingSystemFamily.LINUX ), objects.named( OperatingSystemFamily, OperatingSystemFamily.MAC_OS )] ) + // binaries.configureEach { // Resolve a standard name for the platform. def platform = standardOperatingSystem( targetPlatform ) diff --git a/core/java/algorithm/build.gradle b/core/java/algorithm/build.gradle index 8e0b8eeb..0b446c73 100644 --- a/core/java/algorithm/build.gradle +++ b/core/java/algorithm/build.gradle @@ -2,27 +2,29 @@ plugins { id 'java-library' } - description = 'Master Password Algorithm Implementation' configurations { - resource + lib } dependencies { implementation group: 'com.lyndir.lhunath.opal', name: 'opal-system', version: '1.7-p1' - api( group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.5' ) + api group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.5' api group: 'org.jetbrains', name: 'annotations', version: '13.0' api group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' - // TODO: pending cross-compilation support - //resource project( path: ':masterpassword-core', configuration: 'releaseSharedRuntimeElements' ) + lib project( path: ':masterpassword-core', configuration: 'default' ) } -jar { - dependsOn task( type: Sync, 'copyResources' ) { - from files( configurations.resource ) - into processResources.outputs.files.singleFile - } +processResources { + dependsOn task( type: Sync, 'copyResources', { + dependsOn configurations.lib { + files.each { libFile -> + from zipTree( libFile ) + into new File( processResources.outputs.files.singleFile, "lib" ) + } + } + } ) } diff --git a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/impl/MPAlgorithmV0.java b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/impl/MPAlgorithmV0.java index 75cf15e4..3a5a3a1b 100644 --- a/core/java/algorithm/src/main/java/com/lyndir/masterpassword/impl/MPAlgorithmV0.java +++ b/core/java/algorithm/src/main/java/com/lyndir/masterpassword/impl/MPAlgorithmV0.java @@ -51,7 +51,7 @@ public class MPAlgorithmV0 extends MPAlgorithm { protected static final int AES_BLOCKSIZE = 128 /* bit */; static { - Native.load( MPAlgorithmV0.class, "mpw" ); + Native.load( MPAlgorithmV0.class, "masterpassword-core" ); } public final Version version = MPAlgorithm.Version.V0; diff --git a/platform-independent/gui-java/build.gradle b/platform-independent/gui-java/build.gradle index e69bd042..4b4911f3 100644 --- a/platform-independent/gui-java/build.gradle +++ b/platform-independent/gui-java/build.gradle @@ -8,10 +8,11 @@ description = 'Master Password GUI' mainClassName = 'com.lyndir.masterpassword.gui.GUI' dependencies { - compile project( ':masterpassword-model' ) + implementation group: 'com.lyndir.lhunath.opal', name: 'opal-system', version: '1.7-p1' + implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.2' + implementation group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0' - compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.2' - compile group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0' + compile project( ':masterpassword-model' ) }