Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ android {
applicationId "com.nightwatch"
minSdkVersion 16
targetSdkVersion 22
versionCode 28
versionCode 45
versionName "1.0.0"
ndk {
abiFilters "armeabi-v7a", "x86"
Expand Down
39 changes: 11 additions & 28 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let srcDir = __SOURCE_DIRECTORY__ </> "src"

let testDir = __SOURCE_DIRECTORY__ </> "tests" </> "IntegrationTests"

let dotnetcliVersion = "2.0.0"
let dotnetcliVersion = DotNetCli.GetDotNetSDKVersionFromGlobalJson()

let mutable dotnetExePath = "dotnet"

Expand Down Expand Up @@ -144,6 +144,12 @@ FinalTarget "CloseAndroid" (fun _ ->

Target "InstallDotNetCore" (fun _ ->
dotnetExePath <- DotNetCli.InstallDotNetSDK dotnetcliVersion
let fi = FileInfo dotnetExePath
let SEPARATOR = if isWindows then ";" else ":"
Environment.SetEnvironmentVariable(
"PATH",
fi.Directory.FullName + SEPARATOR + System.Environment.GetEnvironmentVariable "PATH",
EnvironmentVariableTarget.Process)
)

Target "Restore" (fun _ ->
Expand Down Expand Up @@ -244,13 +250,7 @@ Target "PrepareRelease" (fun _ ->
Target "CompileForTest" (fun _ ->
ActivateFinalTarget "KillProcess"

let result =
ExecProcess (fun info ->
info.FileName <- dotnetExePath
info.WorkingDirectory <- srcDir
info.Arguments <- " fable npm-run compile-for-test") TimeSpan.MaxValue

if result <> 0 then failwith "fable shut down. Please check logs above"
run yarnTool "run fable-splitter -c splitter.config.js --define TEST" srcDir
)

Target "AssembleForTest" (fun _ ->
Expand All @@ -260,12 +260,7 @@ Target "AssembleForTest" (fun _ ->
Target "BuildRelease" (fun _ ->
ActivateFinalTarget "KillProcess"

let result =
ExecProcess (fun info ->
info.FileName <- dotnetExePath
info.WorkingDirectory <- srcDir
info.Arguments <- " fable npm-run build") TimeSpan.MaxValue
if result <> 0 then failwith "fable shut down. Please check logs above"
run yarnTool "run fable-splitter -c splitter.config.js --define RELEASE" srcDir
run gradleTool "assembleRelease --console plain" "android"

let outFile = "android" </> "app" </> "build" </> "outputs" </> "apk" </> "app-release.apk"
Expand All @@ -275,20 +270,8 @@ Target "BuildRelease" (fun _ ->
)

Target "Debug" (fun _ ->
let result =
ExecProcess (fun info ->
info.FileName <- dotnetExePath
info.WorkingDirectory <- srcDir
info.Arguments <- " fable npm-run cold-start") TimeSpan.MaxValue
if result <> 0 then failwith "fable shut down."

let dotnetwatch = async {
let result =
ExecProcess (fun info ->
info.FileName <- dotnetExePath
info.WorkingDirectory <- srcDir
info.Arguments <- " fable npm-run start") TimeSpan.MaxValue
if result <> 0 then failwith "fable shut down." }
run yarnTool "run fable-splitter -c splitter.config.js --define DEBUG" srcDir
let dotnetwatch = async { run yarnTool "run fable-splitter -c splitter.config.js -w --define DEBUG" srcDir }

let reactNativeTool = async { run reactNativeTool "run-android" "" }

Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.1.402"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"appium": "1.7.2",
"babel-core": "6.26.0",
"fable-splitter": "0.1.21"
"fable-compiler": "2.1.12",
"fable-splitter": "2.1.5"
}
}
6 changes: 2 additions & 4 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ nuget Fable.Core

nuget Fable.PowerPack
nuget Fable.React
nuget Fable.React.Native
nuget Fable.React.Native prerelease
nuget Fable.Elmish
nuget Fable.Elmish.React
nuget Fable.Elmish.HMR
nuget Fable.Import.Browser

clitool dotnet-fable

group Test

generate_load_scripts: true
Expand All @@ -25,4 +23,4 @@ group Test
group Build
source https://nuget.org/api/v2

nuget FAKE
nuget FAKE < 5
643 changes: 189 additions & 454 deletions paket.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/Nightwatch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module Nightwatch
open Elmish
open Elmish.React
open Elmish.ReactNative
open Elmish.HMR
// TODO: open Elmish.HMR

let setupBackHandler dispatch =
let setupBackHandler dispatch =
let backHandler () =
dispatch App.Msg.NavigateBack
true
Expand All @@ -23,7 +23,6 @@ Program.mkProgram App.init App.update App.view
#if RELEASE
#else
|> Program.withConsoleTrace
|> Program.withHMR
#endif
|> Program.withReactNative "nightwatch"
|> Program.run
2 changes: 1 addition & 1 deletion src/Nightwatch.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReleaseNotes.fs" />
Expand Down
2 changes: 1 addition & 1 deletion src/ReleaseNotes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let AppVersion = "1.0.0"

let IsPrerelease = false

let AndroidVersionCode = 27
let AndroidVersionCode = 44

let Notes = """
#### 1.0.0 - 17.10.2016
Expand Down
8 changes: 4 additions & 4 deletions src/Scenes/CheckLocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let view (model:Model) (dispatch: Msg -> unit) =
match model.PictureUri with
| Some uri ->
image
[ Source [ Uri uri; IsStatic true]
[ Source (remoteImage [ImageURISourceProperties.Uri uri])
ImageProperties.Style [
ImageStyle.BorderColor "#000000"
FlexStyle.Flex 3.
Expand All @@ -104,11 +104,11 @@ let view (model:Model) (dispatch: Msg -> unit) =

view [ Styles.sceneBackground ]
[ text [ Styles.defaultText ] model.LocationCheckRequest.Name
textInput [
textInputWithChild [
TextInput.TextInputProperties.AutoCorrect false
TextInput.TextInputProperties.Style [
FlexStyle.MarginTop 2.
FlexStyle.MarginBottom 2.
FlexStyle.MarginTop (unbox 2.)
FlexStyle.MarginBottom (unbox 2.)
TextStyle.Color Styles.textColor
ViewStyle.BackgroundColor Styles.inputBackgroundColor
]
Expand Down
7 changes: 6 additions & 1 deletion src/Scenes/Home.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ let update (msg:Msg) model : Model*Cmd<Msg> =
{ model with StatusText = string e.Message }, Cmd.none


let init () = { StatusText = "" }, Cmd.ofMsg GetDemoData
let init () =
printfn "Starting"
let ys = [| 1;2;3 |] |> Array.groupBy (fun x -> x = 2)

printfn "done: %A" ys
{ StatusText = "" }, Cmd.ofMsg GetDemoData

// View
let view (model:Model) (dispatch: Msg -> unit) =
Expand Down
8 changes: 4 additions & 4 deletions src/Scenes/LocationList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ let view (model:Model) (dispatch: Msg -> unit) =
image
[ Source uri
ImageProperties.Style [
FlexStyle.Width 24.
FlexStyle.Height 24.
FlexStyle.Width (unbox 24.)
FlexStyle.Height (unbox 24.)
FlexStyle.AlignSelf Alignment.Center
]
])
Expand All @@ -86,8 +86,8 @@ let view (model:Model) (dispatch: Msg -> unit) =

flatList model.Requests [
InitialNumToRender 20
KeyExtractor (Func<_,_,_>(fun (i,_) _ -> i.ToString()))
RenderItem (Func<_,_>(fun v -> renderItem v.item))
KeyExtractor (fun (i,_) _ -> i.ToString())
RenderItem (fun v -> renderItem v.item)
]
Styles.button "OK" (fun () -> dispatch GoBack)
]
6 changes: 3 additions & 3 deletions src/Styles.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let renderText fontSize =
TextProperties.Style [
TextStyle.Color textColor
TextStyle.TextAlign TextAlignment.Center
FlexStyle.Margin 3.
FlexStyle.Margin (unbox 3.)
TextStyle.FontSize fontSize
]

Expand All @@ -47,7 +47,7 @@ let whitespace<'a> = text [ smallText ] ""
let sceneBackground<'a> =
ViewProperties.Style [
FlexStyle.AlignSelf Alignment.Stretch
FlexStyle.Padding 20.
FlexStyle.Padding (unbox 20.)
ViewStyle.ShadowColor shadowColor
ViewStyle.ShadowOpacity 0.8
ViewStyle.ShadowRadius 3.
Expand All @@ -59,7 +59,7 @@ let sceneBackground<'a> =
let viewPagerBackground<'a> =
ViewPagerAndroidProperties.Style [
FlexStyle.AlignSelf Alignment.Stretch
FlexStyle.Padding 20.
FlexStyle.Padding (unbox 20.)
ViewStyle.ShadowColor shadowColor
ViewStyle.ShadowOpacity 0.8
ViewStyle.ShadowRadius 3.
Expand Down
4 changes: 1 addition & 3 deletions src/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ Fable.React.Native
Fable.Elmish
Fable.Elmish.React
Fable.Elmish.HMR
Fable.Import.Browser

dotnet-fable
Fable.Import.Browser
Loading