OpenBW / BWAPI4J

BWAPI wrapper for Java
GNU Lesser General Public License v3.0
24 stars 9 forks source link

Extract dylib for Mac, Remove Zip Requirement #65

Open muandrew opened 6 years ago

muandrew commented 6 years ago
muandrew commented 6 years ago

tested on mac and ubuntu, please test on windows.

muandrew commented 6 years ago

Hey! Can you refer me to a setup where an external jar is used? I'll test it out before including the Zip file removal changes.

adakitesystems commented 6 years ago

Can you refer me to a setup where an external jar is used? I'll test it out before including the Zip file removal changes.

The stacktrace was generated from the following setup:

muandrew commented 6 years ago

So when I'm testing I'm using a gradle setup. In the setup you described, is the project packaged somehow or does it use a different build system?

apply plugin: 'application'
apply plugin: 'kotlin'

mainClassName = 'com.muandrew.yari.KRunnerKt'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'net.lingala.zip4j:zip4j:1.2.5'
    implementation 'org.apache.logging.log4j:log4j-core:2.11.0'

    implementation project(':lib')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

    testImplementation 'junit:junit:4.12'
}
adakitesystems commented 6 years ago

Yes, the project is packaged as a JAR with the bridge inside. For example, the following Gradle tasks will build and package BWAPI4J as a distributed library JAR to be able to be imported into a project as described above in my post or with Gradle as described in your post if the C++ prereqs are installed on the system. From the root project directory:

git submodule update --init --recursive
cd BWAPI4J/
./gradlew clean build sourcesJar javadocJar buildOpenBWBridgeForLinux
./gradlew shadowJar

The resulting JARs will be found in build/libs/