diff --git a/.travis.yml b/.travis.yml index 7c2a90e8..a5b9e48e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: scala sudo: false script: - - sbt test plugin/scripted + - sbt "so test" jdk: - openjdk6 diff --git a/build.sbt b/build.sbt index 03e37c4e..a7f9e653 100644 --- a/build.sbt +++ b/build.sbt @@ -29,6 +29,7 @@ lazy val root = (project in file(".")). scmInfo := Some(ScmInfo(url("https://github.com/foundweekends/giter8"), "git@github.com:foundweekends/giter8.git")) )), name := "giter8", + crossScalaVersions := List(scala210, scala211), siteGithubRepo := "foundweekends/giter8", siteEmail := { "eed3si9n" + "@" + "gmail.com" } ) @@ -40,6 +41,7 @@ lazy val app = (project in file("app")). settings( description := "Command line tool to apply templates defined on github", name := "giter8", + crossScalaVersions := List(scala210, scala211), sourceDirectory in csRun := { (baseDirectory).value.getParentFile / "src" / "main" / "conscript" }, libraryDependencies ++= Seq(scopt), buildInfoKeys := Seq(name, version, scalaVersion, sbtVersion), @@ -53,13 +55,17 @@ lazy val scaffold = (project in file("scaffold")). name := "sbt-giter8-scaffold", description := "sbt plugin for scaffolding giter8 templates", sbtPlugin := true, + crossScalaVersions := List(scala210), scriptedSettings, scriptedLaunchOpts ++= sys.process.javaVmArguments.filter( a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith) ), scriptedBufferLog := false, scriptedLaunchOpts += ("-Dplugin.version=" + version.value), - scripted <<= ScriptedPlugin.scripted dependsOn(publishLocal in lib) + scripted <<= ScriptedPlugin.scripted dependsOn(publishLocal in lib), + test in Test := { + scripted.toTask("").value + } ) lazy val plugin = (project in file("plugin")). @@ -70,6 +76,7 @@ lazy val plugin = (project in file("plugin")). scriptedSettings, description := "sbt plugin for testing giter8 templates", sbtPlugin := true, + crossScalaVersions := List(scala210), resolvers += Resolver.typesafeIvyRepo("releases"), scriptedLaunchOpts ++= sys.process.javaVmArguments.filter( a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith) @@ -77,7 +84,10 @@ lazy val plugin = (project in file("plugin")). scriptedBufferLog := false, scriptedLaunchOpts += ("-Dplugin.version=" + version.value), scripted <<= ScriptedPlugin.scripted dependsOn(publishLocal in lib), - libraryDependencies <+= sbtVersion("org.scala-sbt" % "scripted-plugin" % _) + libraryDependencies <+= sbtVersion("org.scala-sbt" % "scripted-plugin" % _), + test in Test := { + scripted.toTask("").value + } ) lazy val lib = (project in file("library")). @@ -86,8 +96,14 @@ lazy val lib = (project in file("library")). settings( name := "giter8-lib", description := "shared library for app and plugin", + crossScalaVersions := List(scala210, scala211), libraryDependencies ++= Seq( scalasti, jline, jgit, commonsIo, plexusArchiver, scalacheck % Test, sbtIo % Test - ) + ) ++ + (CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, scalaMajor)) if scalaMajor >= 11 => + Seq(scalaXml, parserCombinator) + case _ => Nil + }) ) diff --git a/notes/0.7.0.markdown b/notes/0.7.0.markdown index 8911b9ac..3aed9a28 100644 --- a/notes/0.7.0.markdown +++ b/notes/0.7.0.markdown @@ -6,28 +6,28 @@ This is the first release since the development is passed on to - We've relicensed Giter8 under Apache v2 license after contacting previous contributors and getting their approvals. [#194][194] - Organization name is changed to `org.foundweekends.giter8`. -- The sbt plugin was renamed to `sbt-giter8` and `sbt-giter8-scaffold`. +- The sbt plugins were renamed to `sbt-giter8` and `sbt-giter8-scaffold`. - Created Pamflet [documentation][docs]. ### bug fixes and improvements - Better error handling when templates do not compile. [#193][193] by [@njlg][@njlg] -- Support git URLs that start with `ssh://`. [#192][192] by [@njlg][@njlg] +- Supports Git URLs that start with `ssh://`. [#192][192] by [@njlg][@njlg] - Fixes sbt-giter8 not expanding dynamic default properties. [#165][165] by [@sattvik][@sattvik] -- `ls(..)` properties is dropped. [#201][201] by [@eed3si9n][@eed3si9n] +- `ls(..)` property is dropped. [#201][201] by [@eed3si9n][@eed3si9n] ### root layout -Giter8 0.7.0 introduces an experimental layout called *root layout*. +Giter8 0.7.0 introduces an *experimental* layout called *root layout*. When Giter8 does not find `src/main/g8`, it will simply use the root directory of the specified Git repository as the template directory. The `default.properties` file can be placed either at the root directory or in `project` directory. -Since you can no longer include template fields in the files -under `project` its application is very limited. [#202][202] by [@eed3si9n][@eed3si9n] +This also means that you can no longer include template fields in the files +under `project`, so the application of root layout is pretty limited. [#202][202] by [@eed3si9n][@eed3si9n] -#### upgrade +### upgrade If you're using conscript: diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 4e5dd18a..201536ea 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,7 +4,7 @@ object Dependencies { val scalasti = "org.clapper" %% "scalasti" % "2.0.0" val jline = "jline" % "jline" % "2.13" val commonsIo = "commons-io" % "commons-io" % "2.4" - val plexusArchiver = "org.codehaus.plexus" % "plexus-archiver" % "2.2" excludeAll( + val plexusArchiver = "org.codehaus.plexus" % "plexus-archiver" % "2.7.1" excludeAll( ExclusionRule("org.apache.commons", "commons-compress"), ExclusionRule("classworlds", "classworlds"), ExclusionRule("org.tukaani", "xz"), @@ -18,4 +18,8 @@ object Dependencies { val scopt = "com.github.scopt" %% "scopt" % "3.5.0" val scalacheck = "org.scalacheck" %% "scalacheck" % "1.13.0" val sbtIo = "org.scala-sbt" %% "io" % "1.0.0-M6" + val scala210 = "2.10.6" + val scala211 = "2.11.8" + val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.0.5" + val parserCombinator = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.3" } diff --git a/project/doge.sbt b/project/doge.sbt new file mode 100644 index 00000000..e1274c94 --- /dev/null +++ b/project/doge.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5")