Skip to content

Commit

Permalink
Replace Gradle with SBT because SBT has a much nicer XJC plugin. The …
Browse files Browse the repository at this point in the history
…project now builds on Java 8 again
  • Loading branch information
Ben McCann committed Mar 20, 2015
1 parent 4fd8c91 commit 3547520
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 155 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ client/src/generated/java

.gradle
build
target

.classpath
.project
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The library is available from the Central Maven Repository and can be used easil

* This library and all dependencies are available in the Maven Central Repository
* Compatible with Java 8 (libraries using JiBX are not due to BCEL dependency)
* Work with standard Java classes like List<Invoice> and Date instead of ArrayOfInvoice and JAXBElement<GregorianCalendar>
* Work with standard Java classes like List<Invoice> and Date (other libraries using JAXB give you things like ArrayOfInvoice and JAXBElement<GregorianCalendar>)
* Easily extensible - protected, non-final client

## Not yet supported
Expand All @@ -33,14 +33,6 @@ Currently, only the private app authentication method has been implemented. We u

## Hacking on this library

The Gradle build tool must be installed and [Xero's XML schema library](https://github.com/XeroAPI/XeroAPI-Schemas) must be checked out as a sibling project. Build with:
The SBT build tool must be installed and [Xero's XML schema library](https://github.com/XeroAPI/XeroAPI-Schemas) must be checked out as a sibling project. Build with:

gradle compileJava

Note that you can only run via Gradle and not via an IDE. See the [JiBX binding page](http://jibx.sourceforge.net/bindcomp.html#ide-use) for more details.

## Deploying to Maven Central

Project admin can run:

gradle uploadArchives
sbt compile
1 change: 0 additions & 1 deletion build.gradle

This file was deleted.

97 changes: 0 additions & 97 deletions client/build.gradle

This file was deleted.

25 changes: 25 additions & 0 deletions client/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2015 Connectifier, Inc. All Rights Reserved.

organization := "com.connectifier.xero"
name := "client"
version := "0.12-SNAPSHOT"

// Java. Not Scala
crossPaths := false
autoScalaLibrary := false

// XJC-plugin settings
sources in (Compile, xjc) += baseDirectory.value / ".." / ".." / "XeroAPI-Schemas" / "v2.00"
xjcCommandLine += "-p"
xjcCommandLine += "com.connectifier.xeroclient.models"
xjcBindings += "src/main/resources/bindings.xjb"
xjcPlugins += "com.connectifier.xero" % "xjc-plugin" % "0.1-SNAPSHOT"
xjcCommandLine += "-Xcustom"

libraryDependencies ++= Seq(
"com.google.guava" % "guava" % "18.0",
"org.bouncycastle" % "bcpkix-jdk15on" % "1.51",
"org.scribe" % "scribe" % "1.3.5",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test"
)
6 changes: 0 additions & 6 deletions client/gradle.properties

This file was deleted.

1 change: 1 addition & 0 deletions client/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.7
3 changes: 3 additions & 0 deletions client/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")

addSbtPlugin("org.scala-sbt.plugins" % "sbt-xjc" % "0.7")
File renamed without changes.
1 change: 0 additions & 1 deletion settings.gradle

This file was deleted.

39 changes: 0 additions & 39 deletions source-gen/build.gradle

This file was deleted.

15 changes: 15 additions & 0 deletions xjc-plugin/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2015 Connectifier, Inc. All Rights Reserved.

organization := "com.connectifier.xero"
name := "xjc-plugin"
version := "0.1-SNAPSHOT"

// Java. Not Scala
crossPaths := false
autoScalaLibrary := false

libraryDependencies ++= Seq(
"org.glassfish.jaxb" % "jaxb-xjc" % "2.2.11",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test"
)
1 change: 1 addition & 0 deletions xjc-plugin/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.7

0 comments on commit 3547520

Please sign in to comment.