diff --git a/build.sbt b/build.sbt index 287900b..85550e1 100644 --- a/build.sbt +++ b/build.sbt @@ -19,75 +19,72 @@ lazy val macroid = (project in file(".")) ) lazy val core = (project in file("macroid-core")) - .enablePlugins(AndroidLib) - .settings(commonSettings: _*) - .settings( - libraryDependencies += "org.scalameta" %% "scalameta" % "1.8.0" % Provided, - macroAnnotationSettings) - .settings( - name := "macroid", - description := "A Scala GUI DSL for Android", - homepage := Some(url("http://47deg.github.io/macroid")), - libraryDependencies ++= Seq( - "org.scala-lang.modules" %% "scala-async" % "0.9.6"), - unmanagedSourceDirectories in Test := Seq( - baseDirectory.value / "src" / "test" / "scala") - ) - .settings( - platformTarget in Android := platformV, - unmanagedClasspath in Test ++= (bootClasspath in Android).value - ) + .enablePlugins(AndroidLib) + .settings(commonSettings: _*) + .settings(macroSettings: _*) + .settings( + name := "macroid", + description := "A Scala GUI DSL for Android", + homepage := Some(url("http://47deg.github.io/macroid")), + platformTarget in Android := platformV, + unmanagedClasspath in Test ++= (bootClasspath in Android).value, + unmanagedSourceDirectories in Test := Seq( + baseDirectory.value / "src" / "test" / "scala"), + libraryDependencies ++= Seq( + "org.scala-lang.modules" %% "scala-async" % "0.9.6" + ) + ) lazy val viewable = (project in file("macroid-viewable")) - .enablePlugins(AndroidLib) - .settings(commonSettings: _*) - .settings( - name := "macroid-viewable", - description := "Typeclasses to turn data into Android layouts", - homepage := Some( - url("http://47deg.github.io/macroid/docs/modules/Viewable.html")), - platformTarget in Android := platformV, - unmanagedClasspath in Test ++= (bootClasspath in Android).value - ) - .dependsOn(core) + .enablePlugins(AndroidLib) + .settings(commonSettings: _*) + .settings( + name := "macroid-viewable", + description := "Typeclasses to turn data into Android layouts", + platformTarget in Android := platformV, + unmanagedClasspath in Test ++= (bootClasspath in Android).value, + homepage := Some( + url("http://47deg.github.io/macroid/docs/modules/Viewable.html")) + ) + .dependsOn(core) lazy val akka = (project in file("macroid-akka")) - .enablePlugins(AndroidLib) - .settings(commonSettings: _*) - .settings( - name := "macroid-akka", - description := "Helpers to attach Akka Actors to Android Fragments", - homepage := Some( - url("http://47deg.github.io/macroid/docs/modules/Akka.html")), - platformTarget in Android := platformV, - unmanagedClasspath in Test ++= (bootClasspath in Android).value, - libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.5.3" - ) - .dependsOn(core) + .enablePlugins(AndroidLib) + .settings(commonSettings: _*) + .settings( + name := "macroid-akka", + description := "Helpers to attach Akka Actors to Android Fragments", + platformTarget in Android := platformV, + unmanagedClasspath in Test ++= (bootClasspath in Android).value, + homepage := Some( + url("http://47deg.github.io/macroid/docs/modules/Akka.html")), + libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.5.3" + ) + .dependsOn(core) lazy val docs = (project in file("macroid-docs")) - .settings(commonSettings: _*) - .settings(micrositeSettings: _*) - .settings(moduleName := "macroid-docs") - .enablePlugins(MicrositesPlugin) - .settings(name := "docs", description := "Macroid Documentation") - .dependsOn(core) + .settings(commonSettings: _*) + .settings(micrositeSettings: _*) + .settings(moduleName := "macroid-docs") + .enablePlugins(MicrositesPlugin) + .settings(name := "docs", description := "Macroid Documentation") + .dependsOn(core) lazy val extras = (project in file("macroid-extras")) - .enablePlugins(AndroidLib) - .settings(commonSettings: _*) - .settings( - name := "macroid-extras", - description := "Tweaks and utilities for android views", - homepage := Some( - url("http://47deg.github.io/macroid/docs/modules/Extras.html")), - platformTarget in Android := platformV, - unmanagedClasspath in Test ++= (bootClasspath in Android).value, - libraryDependencies ++= Seq( - "com.android.support" % "appcompat-v7" % androidV, - "com.android.support" % "recyclerview-v7" % androidV, - "com.android.support" % "cardview-v7" % androidV, - "com.android.support" % "design" % androidV + .enablePlugins(AndroidLib) + .settings(commonSettings: _*) + .settings( + name := "macroid-extras", + description := "Tweaks and utilities for android views", + platformTarget in Android := platformV, + unmanagedClasspath in Test ++= (bootClasspath in Android).value, + homepage := Some( + url("http://47deg.github.io/macroid/docs/modules/Extras.html")), + libraryDependencies ++= Seq( + "com.android.support" % "appcompat-v7" % androidV, + "com.android.support" % "recyclerview-v7" % androidV, + "com.android.support" % "cardview-v7" % androidV, + "com.android.support" % "design" % androidV + ) ) - ) - .dependsOn(core) + .dependsOn(core) diff --git a/macroid-docs/src/main/tut/docs/Installation.md b/macroid-docs/src/main/tut/docs/Installation.md index 8f1926c..378ac94 100644 --- a/macroid-docs/src/main/tut/docs/Installation.md +++ b/macroid-docs/src/main/tut/docs/Installation.md @@ -6,17 +6,17 @@ section: docs # Installation -## Version `3.0.0` +## Version `2.1.0` *Macroid* is packaged in the AAR format and published to [Maven Central](http://central.maven -.org/maven2/org/macroid/macroid_2.11/3.0.0/). +.org/maven2/org/macroid/macroid_2.11/2.1.0/). Assuming sbt version `0.13.x` and [sbt-android](https://github.com/scala-android/sbt-android) version `1.7.8` and above, you can add it to your project like this: ```scala libraryDependencies ++= Seq( - aar("org.macroid" %% "macroid" % "3.0.0") + aar("org.macroid" %% "macroid" % "2.1.0") ``` If you want to use the SNAPSHOT version you need to add the Sonatype SNAPSHOT repo @@ -26,7 +26,7 @@ resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" libraryDependencies ++= Seq( - aar("org.macroid" %% "macroid" % "3.0.0-SNAPSHOT") + aar("org.macroid" %% "macroid" % "2.1.0-SNAPSHOT") ``` ## Version `2.0.0` and below diff --git a/macroid-docs/src/main/tut/docs/index.md b/macroid-docs/src/main/tut/docs/index.md index 72c359d..9cd50cb 100644 --- a/macroid-docs/src/main/tut/docs/index.md +++ b/macroid-docs/src/main/tut/docs/index.md @@ -13,7 +13,7 @@ Striving to be focused on one thing (GUI), *Macroid* promotes composability and Prerequisites: Scala `2.10.x` or `2.11.x`, Android `API 19+`. -Latest version: `3.0.0` ([installation](Installation.html) | [changelog](Changelog.md)). +Latest version: `2.1.0` ([installation](Installation.html) | [changelog](Changelog.md)). * [What does it look like](Tutorial.html) * [How is it different from...](Differences.html) diff --git a/macroid-docs/src/main/tut/docs/modules/Akka.md b/macroid-docs/src/main/tut/docs/modules/Akka.md index e437709..fd184cc 100644 --- a/macroid-docs/src/main/tut/docs/modules/Akka.md +++ b/macroid-docs/src/main/tut/docs/modules/Akka.md @@ -12,15 +12,15 @@ You have to add your version of Akka yourself (see below). ## How to use -Assuming you already have *Macroid* `2.0.0-M4` installed, add this line to your `build.sbt`: +Assuming you already have *Macroid* `2.1.0` installed, add this line to your `build.sbt`: ```scala libraryDependencies ++= Seq( // this library - aar("org.macroid" %% "macroid-akka" % "2.0.0-M4"), + aar("org.macroid" %% "macroid-akka" % "2.1.0"), // akka, if not included before - "com.typesafe.akka" %% "akka-actor" % "2.3.9" + "com.typesafe.akka" %% "akka-actor" % "2.5.3" ) // Proguard rules diff --git a/macroid-docs/src/main/tut/docs/modules/Extras.md b/macroid-docs/src/main/tut/docs/modules/Extras.md index b629aed..991f097 100644 --- a/macroid-docs/src/main/tut/docs/modules/Extras.md +++ b/macroid-docs/src/main/tut/docs/modules/Extras.md @@ -10,9 +10,9 @@ An heterogenous collection of traits and objects. Macroid-Extras implements some ## Installation -Assuming you already have *Macroid* `2.0` installed, add this line to your `build.sbt`: +Assuming you already have *Macroid* `2.1.0` installed, add this line to your `build.sbt`: ```scala -libraryDependencies += aar("org.macroid" %% "macroid-extras" % "2.0") +libraryDependencies += aar("org.macroid" %% "macroid-extras" % "2.1.0") ``` diff --git a/macroid-docs/src/main/tut/docs/modules/Viewable.md b/macroid-docs/src/main/tut/docs/modules/Viewable.md index e8db825..17177b1 100644 --- a/macroid-docs/src/main/tut/docs/modules/Viewable.md +++ b/macroid-docs/src/main/tut/docs/modules/Viewable.md @@ -14,10 +14,10 @@ This module provides typeclasses to convert data to Android layouts. It offers t ## Installation -Assuming you already have *Macroid* `2.0.0-M4` installed, add this line to your `build.sbt`: +Assuming you already have *Macroid* `2.1.0` installed, add this line to your `build.sbt`: ```scala -libraryDependencies += aar("org.macroid" %% "macroid-viewable" % "2.0.0-M4") +libraryDependencies += aar("org.macroid" %% "macroid-viewable" % "2.1.0") ``` ## Viewable diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 561a7c0..1eabc18 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -10,7 +10,7 @@ object ProjectPlugin extends AutoPlugin { lazy val micrositeSettings = Seq( micrositeName := "macroid", micrositeDescription := "A modular functional user interface creation language for Android," + - "" + " implemented with Scala macros", + "" + " implemented with Scala macros", micrositeBaseUrl := "macroid", micrositeDocumentationUrl := "/macroid/docs/", micrositeGithubOwner := "47deg", @@ -28,9 +28,10 @@ object ProjectPlugin extends AutoPlugin { ) val androidV = "25.0.1" val platformV = "android-25" + val paradiseVersion = "2.1.0" val commonSettings =Seq( - version := "3.0.0-SNAPSHOT", + version := "2.1.0-SNAPSHOT", licenses += ("MIT", url("http://opensource.org/licenses/MIT")), scalaVersion := "2.11.11", crossScalaVersions := Seq("2.10.6", "2.11.11"), @@ -62,7 +63,7 @@ object ProjectPlugin extends AutoPlugin { homepage := Some(url("http://47deg.github.io/macroid")), scmInfo := Some( ScmInfo(url("https://github.com/47deg/macroid"), - "https://github.com/47deg/macroid.git")), + "https://github.com/47deg/macroid.git")), pomExtra := macroid @@ -75,20 +76,27 @@ object ProjectPlugin extends AutoPlugin { else Some("releases" at nexus + "service/local/staging/deploy/maven2") }, credentials += Credentials("Sonatype Nexus Repository Manager", - "oss.sonatype.org", - sys.env.getOrElse("PUBLISH_USERNAME", ""), - sys.env.getOrElse("PUBLISH_PASSWORD", "")), + "oss.sonatype.org", + sys.env.getOrElse("PUBLISH_USERNAME", ""), + sys.env.getOrElse("PUBLISH_PASSWORD", "")), publishArtifact in Test := false ) ++ addCommandAlias( "testAndCover", "; clean; coverage; test; coverageReport; coverageAggregate") - lazy val macroAnnotationSettings = Seq( - addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M9" cross CrossVersion.full), - scalacOptions += "-Xplugin-require:macroparadise", - scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise")) // macroparadise plugin doesn't work in repl yet. + val macroSettings = Seq( + libraryDependencies ++= Seq( + "org.scala-lang" % "scala-reflect" % scalaVersion.value, // required by macro-compat + "org.typelevel" %% "macro-compat" % "1.1.1", + "org.scala-lang" % "scala-compiler" % scalaVersion.value, + compilerPlugin( + "org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full) + ), + libraryDependencies ++= (scalaBinaryVersion.value match { + case "2.10" => Seq("org.scalamacros" %% "quasiquotes" % paradiseVersion) + case _ ⇒ Seq() + }) ) - } } diff --git a/version.sbt b/version.sbt index 5051b75..4ce70f5 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "3.0.0-SNAPSHOT" +version in ThisBuild := "2.1.0-SNAPSHOT"