2
0

Fix inter-project dependency and including libs into algorithm jar.

This commit is contained in:
Maarten Billemont 2018-05-27 23:43:35 -04:00
parent 0b044ab9a4
commit a0447298d3
4 changed files with 26 additions and 23 deletions

View File

@ -8,9 +8,8 @@ plugins {
description = 'Master Password Algorithm Implementation' description = 'Master Password Algorithm Implementation'
task archive( type: Zip ) { artifacts {
dependsOn assemble 'default' task( type: Zip, "archive" ) {
components.withType( ComponentWithRuntimeFile ) { components.withType( ComponentWithRuntimeFile ) {
if (isOptimized()) { if (isOptimized()) {
from getRuntimeFile() from getRuntimeFile()
@ -19,6 +18,7 @@ task archive( type: Zip ) {
} }
} }
} }
}
library { library {
linkage.set( [Linkage.STATIC, Linkage.SHARED] ) linkage.set( [Linkage.STATIC, Linkage.SHARED] )
@ -34,7 +34,6 @@ library {
} }
} }
components.withType( CppComponent ) { components.withType( CppComponent ) {
// Reconfigure the toolchain from C++ to C.
cppSource.from fileTree( dir: "src", include: "**/*.c" ) cppSource.from fileTree( dir: "src", include: "**/*.c" )
} }
@ -43,6 +42,7 @@ library {
objects.named( OperatingSystemFamily, OperatingSystemFamily.LINUX ), objects.named( OperatingSystemFamily, OperatingSystemFamily.LINUX ),
objects.named( OperatingSystemFamily, OperatingSystemFamily.MAC_OS )] ) objects.named( OperatingSystemFamily, OperatingSystemFamily.MAC_OS )] )
//
binaries.configureEach { binaries.configureEach {
// Resolve a standard name for the platform. // Resolve a standard name for the platform.
def platform = standardOperatingSystem( targetPlatform ) def platform = standardOperatingSystem( targetPlatform )

View File

@ -2,27 +2,29 @@ plugins {
id 'java-library' id 'java-library'
} }
description = 'Master Password Algorithm Implementation' description = 'Master Password Algorithm Implementation'
configurations { configurations {
resource lib
} }
dependencies { dependencies {
implementation group: 'com.lyndir.lhunath.opal', name: 'opal-system', version: '1.7-p1' 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: 'org.jetbrains', name: 'annotations', version: '13.0'
api group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' api group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
// TODO: pending cross-compilation support lib project( path: ':masterpassword-core', configuration: 'default' )
//resource project( path: ':masterpassword-core', configuration: 'releaseSharedRuntimeElements' )
} }
jar { processResources {
dependsOn task( type: Sync, 'copyResources' ) { dependsOn task( type: Sync, 'copyResources', {
from files( configurations.resource ) dependsOn configurations.lib {
into processResources.outputs.files.singleFile files.each { libFile ->
from zipTree( libFile )
into new File( processResources.outputs.files.singleFile, "lib" )
} }
} }
} )
}

View File

@ -51,7 +51,7 @@ public class MPAlgorithmV0 extends MPAlgorithm {
protected static final int AES_BLOCKSIZE = 128 /* bit */; protected static final int AES_BLOCKSIZE = 128 /* bit */;
static { static {
Native.load( MPAlgorithmV0.class, "mpw" ); Native.load( MPAlgorithmV0.class, "masterpassword-core" );
} }
public final Version version = MPAlgorithm.Version.V0; public final Version version = MPAlgorithm.Version.V0;

View File

@ -8,10 +8,11 @@ description = 'Master Password GUI'
mainClassName = 'com.lyndir.masterpassword.gui.GUI' mainClassName = 'com.lyndir.masterpassword.gui.GUI'
dependencies { 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 project( ':masterpassword-model' )
compile group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0'
} }