From 21cf971ce240f998269d75917e018c1fb397a460 Mon Sep 17 00:00:00 2001 From: chandu0101 Date: Thu, 28 Dec 2017 23:26:49 +0530 Subject: [PATCH] update --- .travis.yml | 3 +- build.sbt | 22 +++++++-------- package.json | 2 +- project/build.properties | 2 +- project/plugins.sbt | 8 +++--- .../sri/mobile/components/StatusBar.scala | 19 ++++++------- .../scala/sri/mobile/components/WebView.scala | 12 +++----- .../android/DrawerLayoutAndroid.scala | 12 +++----- .../android/ProgressBarAndroid.scala | 19 +++++-------- .../components/android/ToolbarAndroid.scala | 9 ++---- .../android/TouchableNativeFeedback.scala | 12 +++----- .../components/android/ViewPagerAndroid.scala | 28 ++++++++----------- .../mobile/components/ios/DatePickerIOS.scala | 28 ++++++++----------- .../components/ios/ProgressViewIOS.scala | 8 ++---- .../components/ios/SegmentedControlIOS.scala | 11 ++------ .../sri/mobile/components/ios/TabBarIOS.scala | 19 ++++++------- src/test/scala/sri/mobile/SimpleTest.scala | 4 +-- 17 files changed, 86 insertions(+), 132 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d52a6c..73d6f60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ language: scala scala: -- 2.12.2 -- 2.11.11 +- 2.12.4 jdk: - oraclejdk8 diff --git a/build.sbt b/build.sbt index 8c5b85d..a94d561 100644 --- a/build.sbt +++ b/build.sbt @@ -1,16 +1,15 @@ name := "mobile" -//version := "2017.7.0-SNAPSHOT" +//version := "2017.12.0-SNAPSHOT" enablePlugins(ScalaJSPlugin) -val scala211 = "2.11.11" -val scala212 = "2.12.2" +val scala212 = "2.12.4" -scalaVersion := scala211 +scalaVersion := scala212 -crossScalaVersions := Seq(scala211, scala212) +crossScalaVersions := Seq(scala212) scalacOptions ++= Seq( "-feature", @@ -22,8 +21,8 @@ scalacOptions ++= Seq( //Dependencies libraryDependencies ++= Seq( - "scalajs-react-interface" %%% "universal" % "2017.7.9-RC" % Provided, - "scalajs-react-interface" %%% "core" % "2017.7.9-RC" % Provided) + "scalajs-react-interface" %%% "universal" % "2017.12.28-RC" % Provided, + "scalajs-react-interface" %%% "core" % "2017.12.28-RC" % Provided) //bintray resolvers += Resolver.jcenterRepo @@ -71,12 +70,13 @@ def runJest() = { if (jestResult != 0) throw new IllegalStateException("Jest Suite failed") } -resolvers += Resolver.bintrayRepo("scalajs-react-interface", "maven") -resolvers += Resolver.bintrayRepo("scalajs-jest", "maven") +resolvers ++=Seq(Resolver.bintrayRepo("scalajs-react-interface", "maven"), + Resolver.bintrayRepo("scalajs-jest", "maven"), + Resolver.bintrayRepo("scalajs-plus", "maven")) libraryDependencies ++= Seq( - "org.scala-js" %%% "scalajs-dom" % "0.9.3" % Test, - "scalajs-jest" %%% "core" % "2017.7.9-beta" % Test + "org.scala-js" %%% "scalajs-dom" % "0.9.4" % Test, + "scalajs-jest" %%% "core" % "2017.12.27-RC" % Test ) //scalaJSStage in Global := FastOptStage scalaJSStage in Global := FullOptStage diff --git a/package.json b/package.json index cd48de5..a7a9484 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,6 @@ }, "devDependencies": {}, "dependencies": { - "jest": "^20.0.4" + "jest": "^22.0.4" } } diff --git a/project/build.properties b/project/build.properties index 6818e9c..cd928ea 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,2 +1,2 @@ -sbt.version=0.13.15 +sbt.version=1.0.4 diff --git a/project/plugins.sbt b/project/plugins.sbt index 490cb0e..392b7d9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M1") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "1.3.0") -addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M2") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "2.0.0") +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.2") diff --git a/src/main/scala/sri/mobile/components/StatusBar.scala b/src/main/scala/sri/mobile/components/StatusBar.scala index 7ceb893..591d306 100644 --- a/src/main/scala/sri/mobile/components/StatusBar.scala +++ b/src/main/scala/sri/mobile/components/StatusBar.scala @@ -1,12 +1,8 @@ package sri.mobile.components import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import scala.scalajs.js @@ -37,11 +33,12 @@ trait StatusBarProps extends js.Object { object StatusBar { @inline - def StatusBar(style: OP[js.Any] = NoValue, - @exclude extraProps: OP[StatusBarProps] = NoValue, - @exclude key: String | Int = null, - @exclude ref: js.Function1[StatusBarComponent.type, Unit] = - null)(children: ReactNode*) + def StatusBar( + style: OP[js.Any] = NoValue, + @exclude extraProps: OP[StatusBarProps] = NoValue, + @exclude key: String | Int = null, + @exclude ref: js.Function1[StatusBarComponent.type, Unit] = null)( + children: ReactNode*) : ReactElement { type Instance = StatusBarComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/WebView.scala b/src/main/scala/sri/mobile/components/WebView.scala index 0ebe9f7..68f9988 100644 --- a/src/main/scala/sri/mobile/components/WebView.scala +++ b/src/main/scala/sri/mobile/components/WebView.scala @@ -1,12 +1,8 @@ package sri.mobile.components import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.mobile.WebViewEvent import sri.universal.components._ import sri.universal.{MergeJSObjects, ReactEvent} @@ -43,8 +39,8 @@ trait WebViewProps extends ViewProps { val injectedJavaScript: js.UndefOr[String] = js.undefined val scalesPageToFit: js.UndefOr[Boolean] = js.undefined val scrollEnabled: js.UndefOr[Boolean] = js.undefined - val onNavigationStateChange - : js.UndefOr[js.Function1[NavigationState, Unit]] = js.undefined + val onNavigationStateChange: js.UndefOr[js.Function1[NavigationState, Unit]] = + js.undefined val bounces: js.UndefOr[Boolean] = js.undefined val allowUniversalAccessFromFileURLs: js.UndefOr[Boolean] = js.undefined val domStorageEnabled: js.UndefOr[Boolean] = js.undefined diff --git a/src/main/scala/sri/mobile/components/android/DrawerLayoutAndroid.scala b/src/main/scala/sri/mobile/components/android/DrawerLayoutAndroid.scala index 2c99a64..c827121 100644 --- a/src/main/scala/sri/mobile/components/android/DrawerLayoutAndroid.scala +++ b/src/main/scala/sri/mobile/components/android/DrawerLayoutAndroid.scala @@ -1,12 +1,8 @@ package sri.mobile.components.android import sri.core._ -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.mobile.DrawerLayoutAndroidEvent import sri.universal.{MergeJSObjects, ReactEvent} @@ -71,8 +67,8 @@ object DrawerLayoutAndroid { style: OP[js.Any] = NoValue, @exclude extraProps: OP[DrawerLayoutAndroidProps] = NoValue, @exclude key: String | Int = null, - @exclude ref: js.Function1[DrawerLayoutAndroidComponent.type, Unit] = - null)(children: ReactNode*) + @exclude ref: js.Function1[DrawerLayoutAndroidComponent.type, Unit] = null)( + children: ReactNode*) : ReactElement { type Instance = DrawerLayoutAndroidComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/android/ProgressBarAndroid.scala b/src/main/scala/sri/mobile/components/android/ProgressBarAndroid.scala index 6da4ba0..8ac9d03 100644 --- a/src/main/scala/sri/mobile/components/android/ProgressBarAndroid.scala +++ b/src/main/scala/sri/mobile/components/android/ProgressBarAndroid.scala @@ -1,12 +1,8 @@ package sri.mobile.components.android import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import scala.scalajs.js @@ -42,12 +38,11 @@ object ProgressBarAndroidStyle { object ProgressBarAndroid { @inline - def apply( - style: OP[js.Any] = NoValue, - @exclude extraProps: OP[ProgressBarAndroidProps] = NoValue, - @exclude key: String | Int = null, - @exclude ref: js.Function1[ProgressBarAndroidComponent.type, Unit] = null)( - children: ReactNode*) + def apply(style: OP[js.Any] = NoValue, + @exclude extraProps: OP[ProgressBarAndroidProps] = NoValue, + @exclude key: String | Int = null, + @exclude ref: js.Function1[ProgressBarAndroidComponent.type, Unit] = + null)(children: ReactNode*) : ReactElement { type Instance = ProgressBarAndroidComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/android/ToolbarAndroid.scala b/src/main/scala/sri/mobile/components/android/ToolbarAndroid.scala index c3d4e48..48cb3e6 100644 --- a/src/main/scala/sri/mobile/components/android/ToolbarAndroid.scala +++ b/src/main/scala/sri/mobile/components/android/ToolbarAndroid.scala @@ -1,13 +1,8 @@ package sri.mobile.components.android import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - rename, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import sri.universal.components._ diff --git a/src/main/scala/sri/mobile/components/android/TouchableNativeFeedback.scala b/src/main/scala/sri/mobile/components/android/TouchableNativeFeedback.scala index 4261e83..6431ffb 100644 --- a/src/main/scala/sri/mobile/components/android/TouchableNativeFeedback.scala +++ b/src/main/scala/sri/mobile/components/android/TouchableNativeFeedback.scala @@ -1,12 +1,8 @@ package sri.mobile.components.android import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import sri.universal.components._ @@ -24,8 +20,8 @@ object TouchableNativeFeedbackComponent def SelectableBackgroundBorderless(): NativeFeedbackBackgroundType = js.native - def Ripple(color: String, - borderless: Boolean): NativeFeedbackBackgroundType = js.native + def Ripple(color: String, borderless: Boolean): NativeFeedbackBackgroundType = + js.native } diff --git a/src/main/scala/sri/mobile/components/android/ViewPagerAndroid.scala b/src/main/scala/sri/mobile/components/android/ViewPagerAndroid.scala index ab7dbe2..27b8be2 100644 --- a/src/main/scala/sri/mobile/components/android/ViewPagerAndroid.scala +++ b/src/main/scala/sri/mobile/components/android/ViewPagerAndroid.scala @@ -1,12 +1,8 @@ package sri.mobile.components.android import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.mobile.ViewPagerAndroidEvent import sri.universal.components._ import sri.universal.{MergeJSObjects, ReactEvent} @@ -54,16 +50,16 @@ object KeyboardDismissModeViewPager { object ViewPagerAndroid { @inline - def apply(style: OP[js.Any] = NoValue, - initialPage: OP[Int] = NoValue, - onPageScrollStateChanged: OP[String => _] = NoValue, - onPageScroll: OP[ReactEvent[ViewPagerAndroidEvent] => _] = NoValue, - onPageSelected: OP[ReactEvent[ViewPagerAndroidEvent] => _] = - NoValue, - @exclude extraProps: OP[ViewPagerAndroidProps] = NoValue, - @exclude key: String | Int = null, - @exclude ref: js.Function1[ViewPagerAndroidComponent.type, Unit] = - null)(children: ReactNode*) + def apply( + style: OP[js.Any] = NoValue, + initialPage: OP[Int] = NoValue, + onPageScrollStateChanged: OP[String => _] = NoValue, + onPageScroll: OP[ReactEvent[ViewPagerAndroidEvent] => _] = NoValue, + onPageSelected: OP[ReactEvent[ViewPagerAndroidEvent] => _] = NoValue, + @exclude extraProps: OP[ViewPagerAndroidProps] = NoValue, + @exclude key: String | Int = null, + @exclude ref: js.Function1[ViewPagerAndroidComponent.type, Unit] = null)( + children: ReactNode*) : ReactElement { type Instance = ViewPagerAndroidComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/ios/DatePickerIOS.scala b/src/main/scala/sri/mobile/components/ios/DatePickerIOS.scala index 8141c1d..87df440 100644 --- a/src/main/scala/sri/mobile/components/ios/DatePickerIOS.scala +++ b/src/main/scala/sri/mobile/components/ios/DatePickerIOS.scala @@ -1,12 +1,8 @@ package sri.mobile.components.ios import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import scala.scalajs.js @@ -56,16 +52,16 @@ object MinuteInterval { object DatePickerIOS { @inline - def apply(style: OP[js.Any] = NoValue, - mode: OP[DatePickerIOSMode] = NoValue, - minuteInterval: OP[MinuteInterval] = NoValue, - timeZoneOffsetInMinutes: OP[Int] = NoValue, - onDateChange: OP[js.Date => _] = NoValue, - date: js.Date, - @exclude extraProps: OP[DatePickerIOSProps] = NoValue, - @exclude key: String | Int = null, - @exclude ref: js.Function1[DatePickerIOSComponent.type, Unit] = - null) + def apply( + style: OP[js.Any] = NoValue, + mode: OP[DatePickerIOSMode] = NoValue, + minuteInterval: OP[MinuteInterval] = NoValue, + timeZoneOffsetInMinutes: OP[Int] = NoValue, + onDateChange: OP[js.Date => _] = NoValue, + date: js.Date, + @exclude extraProps: OP[DatePickerIOSProps] = NoValue, + @exclude key: String | Int = null, + @exclude ref: js.Function1[DatePickerIOSComponent.type, Unit] = null) : ReactElement { type Instance = DatePickerIOSComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/ios/ProgressViewIOS.scala b/src/main/scala/sri/mobile/components/ios/ProgressViewIOS.scala index f73fccd..d29f702 100644 --- a/src/main/scala/sri/mobile/components/ios/ProgressViewIOS.scala +++ b/src/main/scala/sri/mobile/components/ios/ProgressViewIOS.scala @@ -1,12 +1,8 @@ package sri.mobile.components.ios import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import sri.universal.components._ diff --git a/src/main/scala/sri/mobile/components/ios/SegmentedControlIOS.scala b/src/main/scala/sri/mobile/components/ios/SegmentedControlIOS.scala index 97ee41a..ad7fd2d 100644 --- a/src/main/scala/sri/mobile/components/ios/SegmentedControlIOS.scala +++ b/src/main/scala/sri/mobile/components/ios/SegmentedControlIOS.scala @@ -1,12 +1,8 @@ package sri.mobile.components.ios import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import sri.universal.components._ @@ -43,8 +39,7 @@ object SegmentedControlIOS { values: js.Array[String], @exclude extraProps: OP[SegmentedControlIOSProps] = NoValue, @exclude key: String | Int = null, - @exclude ref: js.Function1[SegmentedControlIOSComponent.type, Unit] = - null) + @exclude ref: js.Function1[SegmentedControlIOSComponent.type, Unit] = null) : ReactElement { type Instance = SegmentedControlIOSComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/main/scala/sri/mobile/components/ios/TabBarIOS.scala b/src/main/scala/sri/mobile/components/ios/TabBarIOS.scala index 3e364b7..9354cec 100644 --- a/src/main/scala/sri/mobile/components/ios/TabBarIOS.scala +++ b/src/main/scala/sri/mobile/components/ios/TabBarIOS.scala @@ -1,12 +1,8 @@ package sri.mobile.components.ios import sri.core.{JSComponent, _} -import sri.macros.{ - FunctionObjectMacro, - exclude, - OptDefault => NoValue, - OptionalParam => OP -} +import scalajsplus.macros.{FunctionObjectMacro, exclude, rename} +import scalajsplus.{OptDefault => NoValue, OptionalParam => OP} import sri.universal.MergeJSObjects import sri.universal.components._ @@ -94,11 +90,12 @@ object TabBarIOSC { object TabBarIOSItem { @inline - def apply(style: OP[js.Any] = NoValue, - @exclude extraProps: OP[TabBarIOSItemProps] = NoValue, - @exclude key: String | Int = null, - @exclude ref: js.Function1[TabBarIOSItemComponent.type, Unit] = - null)(children: ReactNode) + def apply( + style: OP[js.Any] = NoValue, + @exclude extraProps: OP[TabBarIOSItemProps] = NoValue, + @exclude key: String | Int = null, + @exclude ref: js.Function1[TabBarIOSItemComponent.type, Unit] = null)( + children: ReactNode) : ReactElement { type Instance = TabBarIOSItemComponent.type } = { val props = FunctionObjectMacro() extraProps.foreach(v => { diff --git a/src/test/scala/sri/mobile/SimpleTest.scala b/src/test/scala/sri/mobile/SimpleTest.scala index 3ca8b42..a4fe911 100644 --- a/src/test/scala/sri/mobile/SimpleTest.scala +++ b/src/test/scala/sri/mobile/SimpleTest.scala @@ -2,7 +2,7 @@ package sri.mobile class SimpleTest extends BaseTest { - test("simple", () => { + test("simple") { expect(true).toBeTruthy() - }) + } }