diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0878b60336..1d191608aa 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -28,6 +28,12 @@ + + + + + + - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 23639c372f..94b25ab3a4 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,10 +2,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/OF-sources.iml b/.idea/modules/OF-sources.iml new file mode 100644 index 0000000000..4f6ad741c9 --- /dev/null +++ b/.idea/modules/OF-sources.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/core-build.iml b/.idea/modules/core-build.iml index 4a498859bb..85c5d8ff44 100644 --- a/.idea/modules/core-build.iml +++ b/.idea/modules/core-build.iml @@ -1,93 +1,91 @@ - + - - + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + diff --git a/.idea/modules/core.iml b/.idea/modules/core.iml index def55abad6..d8105b84b7 100644 --- a/.idea/modules/core.iml +++ b/.idea/modules/core.iml @@ -1,29 +1,30 @@ - - - - + + + + - + - + + + - + - + + - - - + + + - - - - + + @@ -33,7 +34,6 @@ - diff --git a/.idea/modules/formBuilder-build.iml b/.idea/modules/formBuilder-build.iml index 90736e37c7..15cbbac068 100644 --- a/.idea/modules/formBuilder-build.iml +++ b/.idea/modules/formBuilder-build.iml @@ -1,5 +1,5 @@ - + @@ -14,75 +14,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/modules/formBuilder.iml b/.idea/modules/formBuilder.iml index 20250c535b..a7b023ea8c 100644 --- a/.idea/modules/formBuilder.iml +++ b/.idea/modules/formBuilder.iml @@ -1,15 +1,17 @@ - + + + @@ -19,18 +21,10 @@ - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/.idea/modules/formBuilderSharedJS-build.iml b/.idea/modules/formBuilderSharedJS-build.iml new file mode 100644 index 0000000000..9a9d38bc98 --- /dev/null +++ b/.idea/modules/formBuilderSharedJS-build.iml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/formBuilderSharedJS.iml b/.idea/modules/formBuilderSharedJS.iml new file mode 100644 index 0000000000..9da83d79b5 --- /dev/null +++ b/.idea/modules/formBuilderSharedJS.iml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/formBuilderSharedJVM-build.iml b/.idea/modules/formBuilderSharedJVM-build.iml new file mode 100644 index 0000000000..1b0e570222 --- /dev/null +++ b/.idea/modules/formBuilderSharedJVM-build.iml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/formBuilderSharedJVM.iml b/.idea/modules/formBuilderSharedJVM.iml new file mode 100644 index 0000000000..6b6bf2de85 --- /dev/null +++ b/.idea/modules/formBuilderSharedJVM.iml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/resourcesPackaged-build.iml b/.idea/modules/resourcesPackaged-build.iml new file mode 100644 index 0000000000..02d69c7e83 --- /dev/null +++ b/.idea/modules/resourcesPackaged-build.iml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/resourcesPackaged.iml b/.idea/modules/resourcesPackaged.iml new file mode 100644 index 0000000000..ec512d21f8 --- /dev/null +++ b/.idea/modules/resourcesPackaged.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/sbt.xml b/.idea/sbt.xml index 0628f59172..9eecf52b35 100644 --- a/.idea/sbt.xml +++ b/.idea/sbt.xml @@ -4,25 +4,23 @@ diff --git a/.idea/scala_compiler.xml b/.idea/scala_compiler.xml index 144edfe811..cd991a9352 100644 --- a/.idea/scala_compiler.xml +++ b/.idea/scala_compiler.xml @@ -8,11 +8,47 @@ \ No newline at end of file diff --git a/build.sbt b/build.sbt index 0e2de36550..8e9fc37ccf 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,18 @@ +val ScalaVersion = "2.11.8" +val ScalaJsDomVersion = "0.9.0" +val ScalaJsJQueryVersion = "0.9.0" + +val OrbeonFormsVersion = "2016.2-SNAPSHOT" + val ExplodedWarWebInf = "build/orbeon-war/WEB-INF" val ExplodedWarClassesPath = ExplodedWarWebInf + "/classes" +val CompileClassesPath = "build/classes" +val TestClassesPath = "build/test-classes" + +val CompileClasspathForEnv = if (sys.props.get("orbeon.env") == Some("dev")) ExplodedWarClassesPath else CompileClassesPath +val OrbeonVersion = sys.props.get("orbeon.version") getOrElse OrbeonFormsVersion +val OrbeonEdition = sys.props.get("orbeon.edition") getOrElse "CE" + val ExplodedWarResourcesPath = ExplodedWarWebInf + "/resources" val FormBuilderResourcesPathInWar = "forms/orbeon/builder/resources" @@ -14,6 +27,7 @@ def copyScalaJSToExplodedWar(sourceFile: File, rootDirectory: File): Unit = { sourceFile.name match { case ScalaJSFileNameFormat(_, prefix, optType) ⇒ prefix → optType } val launcherName = s"$prefix-launcher.js" + val jsdepsName = s"$prefix-jsdeps.js" val sourceMapName = s"${sourceFile.name}.map" val targetDir = @@ -24,6 +38,7 @@ def copyScalaJSToExplodedWar(sourceFile: File, rootDirectory: File): Unit = { val names = List( sourceFile → s"$prefix.js", (sourceFile.getParentFile / launcherName) → launcherName, + (sourceFile.getParentFile / jsdepsName) → jsdepsName, (sourceFile.getParentFile / sourceMapName) → sourceMapName ) @@ -35,25 +50,69 @@ def copyScalaJSToExplodedWar(sourceFile: File, rootDirectory: File): Unit = { ) } -lazy val formBuilder = (project in file("builder")). - enablePlugins(ScalaJSPlugin). - settings( - organization := "org.orbeon", - name := "form-builder", - version := "4.11-SNAPSHOT", +lazy val commonSettings = Seq( + organization := "org.orbeon", + version := OrbeonFormsVersion, + scalaVersion := ScalaVersion, + + javacOptions ++= Seq( + "-encoding", "utf8", + "-source", "1.6", + "-target", "1.6" + ), + scalacOptions ++= Seq( + "-encoding", "utf8", + "-feature", + "-language:postfixOps", + "-language:reflectiveCalls", + "-language:implicitConversions", + "-language:higherKinds", + "-language:existentials" + // Consider the following flags +// "-deprecation", +// "-unchecked", +// "-Xfatal-warnings", +// "-Xlint", +// "-Yno-adapted-args", +// "-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole +// "-Ywarn-numeric-widen", +// "-Ywarn-value-discard", +// "-Xfuture", +// "-Ywarn-unused-import" // 2.11 only + ) +) + +lazy val formBuilderShared = (crossProject.crossType(CrossType.Pure) in file("shared")) + .settings( + scalaVersion := ScalaVersion + ) + .jvmSettings( + classDirectory in Compile := baseDirectory.value.getParentFile.getParentFile / CompileClasspathForEnv + ) + .jsSettings( + ) + +lazy val formBuilderSharedJVM = formBuilderShared.jvm +lazy val formBuilderSharedJS = formBuilderShared.js - scalaVersion := "2.11.7", +lazy val formBuilder = (project in file("builder")) + .enablePlugins(ScalaJSPlugin) + .dependsOn(formBuilderSharedJS) + .settings(commonSettings: _*) + .settings( + name := "form-builder", scalaSource in Compile := baseDirectory.value / "src" / "builder" / "scala", javaSource in Compile := baseDirectory.value / "src" / "builder" / "java", resourceDirectory in Compile := baseDirectory.value / "src" / "builder" / "resources", jsDependencies += RuntimeDOM, - jsDependencies += "org.webjars" % "jquery" % "2.1.3" / "2.1.3/jquery.js", - libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.8.1", + libraryDependencies += "org.scala-js" %%% "scalajs-dom" % ScalaJsDomVersion, + libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % ScalaJsJQueryVersion, + + skip in packageJSDependencies := false, - // Temporary, until there is an 0.8.2 which fixes the jquery.js issue unmanagedBase := baseDirectory.value / "lib", persistLauncher in Compile := true, @@ -69,26 +128,44 @@ lazy val formBuilder = (project in file("builder")). ) ) -lazy val core = (project in file(".")). - dependsOn(formBuilder). - settings( - organization := "org.orbeon", +lazy val resourcesPackaged = (project in file("src")) + .settings(commonSettings: _*) + .settings( + name := "orbeon-resources-packaged", + + resourceDirectory in Compile := baseDirectory.value / "resources-packaged", + target := baseDirectory.value / "resources-packaged-target" + ) + +lazy val core = (project in file("src")) + .enablePlugins(BuildInfoPlugin) + .dependsOn(formBuilderSharedJVM) + .settings(commonSettings: _*) + .settings( name := "orbeon-core", - version := "4.11-SNAPSHOT", - scalaVersion := "2.11.7", + buildInfoKeys := Seq[BuildInfoKey]("orbeonVersion" → OrbeonVersion, "orbeonEdition" → OrbeonEdition), + buildInfoPackage := "org.orbeon.oxf.common", - scalaSource in Compile := baseDirectory.value / "src" / "main" / "scala", - javaSource in Compile := baseDirectory.value / "src" / "main" / "java", - resourceDirectory in Compile := baseDirectory.value / "src" / "main" / "resources", + defaultConfiguration := Some(Compile), - scalaSource in Test := baseDirectory.value / "src" / "test" / "scala", - javaSource in Test := baseDirectory.value / "src" / "test" / "java", - resourceDirectory in Test := baseDirectory.value / "src" / "test" / "resources", + scalaSource in Compile := baseDirectory.value / "main" / "scala", + javaSource in Compile := baseDirectory.value / "main" / "java", + resourceDirectory in Compile := baseDirectory.value / "main" / "resources", - unmanagedBase := baseDirectory.value / "lib", + scalaSource in Test := baseDirectory.value / "test" / "scala", + javaSource in Test := baseDirectory.value / "test" / "java", + resourceDirectory in Test := baseDirectory.value / "test" / "resources", - classDirectory in Compile := baseDirectory.value / ExplodedWarClassesPath + unmanagedBase := baseDirectory.value / ".." / "lib", + + classDirectory in Compile := baseDirectory.value / ".." / CompileClasspathForEnv, + classDirectory in Test := baseDirectory.value / ".." / TestClassesPath ) +//lazy val root = (project in file(".")) +// .enablePlugins(BuildInfoPlugin) +// .aggregate(formBuilder, core) +// .settings(commonSettings: _*) + sound.play(compile in Compile, Sounds.Blow, Sounds.Basso) diff --git a/build.xml b/build.xml index 291dcb72f5..185816ec32 100644 --- a/build.xml +++ b/build.xml @@ -31,17 +31,6 @@ - - - - - - - - - - - @@ -339,66 +328,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + @@ -845,12 +792,16 @@ + + + + diff --git a/builder/lib/scalajs-jquery_sjs0.6_2.11.jar b/builder/lib/scalajs-jquery_sjs0.6_2.11.jar deleted file mode 100644 index 4920b92c66..0000000000 Binary files a/builder/lib/scalajs-jquery_sjs0.6_2.11.jar and /dev/null differ diff --git a/project/build.properties b/project/build.properties index a8ca95d9bc..6976a02fbd 100644 --- a/project/build.properties +++ b/project/build.properties @@ -11,4 +11,4 @@ # # The full text of the license is available at http://www.gnu.org/copyleft/lesser.html # -sbt.version=0.13.7 \ No newline at end of file +sbt.version=0.13.9 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index f0dffbbe09..cb5683d745 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.4") -addSbtPlugin("com.orrsella" % "sbt-sound" % "1.0.4") \ No newline at end of file +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9") +addSbtPlugin("com.orrsella" % "sbt-sound" % "1.0.4") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1") \ No newline at end of file diff --git a/src/main/scala/org/orbeon/oxf/common/Version.scala b/src/main/scala/org/orbeon/oxf/common/Version.scala index e0fd2b5172..8438efd7c3 100644 --- a/src/main/scala/org/orbeon/oxf/common/Version.scala +++ b/src/main/scala/org/orbeon/oxf/common/Version.scala @@ -37,8 +37,9 @@ object Version { private val PossibleEditions = Set("CE", "PE") - val VersionNumber = "@RELEASE@" - val Edition = Option("@EDITION@") filter PossibleEditions getOrElse "CE" + val VersionNumber = org.orbeon.oxf.common.BuildInfo.orbeonVersion + val Edition = org.orbeon.oxf.common.BuildInfo.orbeonEdition + val VersionString = "Orbeon Forms " + VersionNumber + ' ' + Edition def versionStringIfAllowed =