Skip to content

Commit

Permalink
Bump JavaCPP version (#8)
Browse files Browse the repository at this point in the history
Bump JavaCPP version, add testing
  • Loading branch information
lloydmeta authored Oct 1, 2016
1 parent 6c6af99 commit e4f641b
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: false
language: scala
jdk:
- oraclejdk8
script:
- sbt scripted
cache:
directories:
- $HOME/.sbt/0.13
- $HOME/.sbt/boot/scala*
- $HOME/.sbt/cache
- $HOME/.sbt/launchers
- $HOME/.ivy2
before_cache:
- du -h -d 1 $HOME/.ivy2/
- du -h -d 2 $HOME/.sbt/
- find $HOME/.sbt -name "*.lock" -type f -delete
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete -print
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SBT-JavaCPP [![Join the chat at https://gitter.im/bytedeco/sbt-javacpp](https://badges.gitter.im/bytedeco/sbt-javacpp.svg)](https://gitter.im/bytedeco/sbt-javacpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/sbt-javacpp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/sbt-javacpp)
# SBT-JavaCPP [![Join the chat at https://gitter.im/bytedeco/sbt-javacpp](https://badges.gitter.im/bytedeco/sbt-javacpp.svg)](https://gitter.im/bytedeco/sbt-javacpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/sbt-javacpp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytedeco/sbt-javacpp) [![Build Status](https://travis-ci.org/bytedeco/sbt-javacpp.svg?branch=master)](https://travis-ci.org/bytedeco/sbt-javacpp)

Makes it easy to start playing around with JavaCPP in an SBT project.

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
classpathTypes += "maven-plugin"

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")
4 changes: 4 additions & 0 deletions project/scripted.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}

7 changes: 7 additions & 0 deletions scripted.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ScriptedPlugin.scriptedSettings

scriptedLaunchOpts := { scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
}

scriptedBufferLog := false
5 changes: 4 additions & 1 deletion src/main/scala/org/bytedeco/sbt/javacpp/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ object Platform {
case _ => Seq(parsePlatformFromJVM)
}

3 +: List(1, 2)

/**
*
* Should be in lockstep with:
Expand All @@ -35,6 +37,7 @@ object Platform {
val jvmOsName = System.getProperty("os.name", "").toLowerCase
val jvmOsArch = System.getProperty("os.arch", "").toLowerCase
val jvmAbiType = System.getProperty("sun.arch.abi", "").toLowerCase()
val jvmLibPath = System.getProperty("sun.boot.library.path", "").toLowerCase()
val osName = jvmOsName match {
case os if jvmName.startsWith("dalvik") && os.startsWith("linux") => "android"
case os if jvmName.startsWith("robovm") && os.startsWith("darwin") => "ios"
Expand All @@ -51,7 +54,7 @@ object Platform {
case "i386" | "i486" | "i586" | "i686" => "x86"
case "amd64" | "x86-64" | "x64" => "x86_64"
case "aarch64" | "armv8" | "arm64" => "arm64"
case arch if arch.startsWith("arm") && jvmAbiType == "gnueabihf" => "armhf"
case arch if (arch.startsWith("arm") && jvmAbiType == "gnueabihf") || jvmLibPath.contains("openjdk-armhf") => "armhf"
case arch if arch.startsWith("arm") || osName == "ios" => "arm"
case other => other
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/org/bytedeco/sbt/javacpp/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object Plugin extends AutoPlugin {
}

object Versions {
val javaCppVersion = "1.2.2"
val javaCppVersion = "1.2.4"
}

object autoImport {
Expand Down
3 changes: 3 additions & 0 deletions src/sbt-test/sbt-javacpp/simple/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version := "0.1"

scalaVersion := "2.11.8"
7 changes: 7 additions & 0 deletions src/sbt-test/sbt-javacpp/simple/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
val pluginVersion = System.getProperty("plugin.version")
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("org.bytedeco" % "sbt-javacpp" % pluginVersion)
}
3 changes: 3 additions & 0 deletions src/sbt-test/sbt-javacpp/simple/src/main/scala/Main.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
object Main extends App {
println("hello")
}
2 changes: 2 additions & 0 deletions src/sbt-test/sbt-javacpp/simple/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Test if the project compiles
> compile

0 comments on commit e4f641b

Please sign in to comment.