@@ -45,6 +45,9 @@ data ObRunState
45doubleQuotes :: (IsString a, Semigroup a) => a -> a
45doubleQuotes :: (IsString a, Semigroup a) => a -> a
46doubleQuotes s = "\"" <> s <> "\""
46doubleQuotes s = "\"" <> s <> "\""
48+routeFile :: IsString a => a
49+routeFile = "config/common/route"
48commit :: Text -> Sh ()
51commit :: Text -> Sh ()
49commit msg = void $ run "git"
52commit msg = void $ run "git"
50 [ "commit"
53 [ "commit"
@@ -149,16 +152,16 @@ main = do
149 it "can build ghc.backend" $ inTmpObInit $ \_ -> nixBuild ["-A", "ghc.backend"]
152 it "can build ghc.backend" $ inTmpObInit $ \_ -> nixBuild ["-A", "ghc.backend"]
150 it "can build ghcjs.frontend" $ inTmpObInit $ \_ -> nixBuild ["-A", "ghcjs.frontend"]
153 it "can build ghcjs.frontend" $ inTmpObInit $ \_ -> nixBuild ["-A", "ghcjs.frontend"]
152− if os == "darwin"
155+ -- if os == "darwin"
153− then it "can build ios" $ inTmpObInit $ \_ -> nixBuild ["-A", "ios.frontend"]
156+ -- then it "can build ios" $ inTmpObInit $ \_ -> nixBuild ["-A", "ios.frontend"]
154− else it "can build android after accepting license" $ inTmpObInit $ \dir -> do
157+ -- else it "can build android after accepting license" $ inTmpObInit $ \dir -> do
155− let defaultNixPath = dir </> ("default.nix" :: Shelly.FilePath)
158+ -- let defaultNixPath = dir </> ("default.nix" :: Shelly.FilePath)
156− writefile defaultNixPath
159+ -- writefile defaultNixPath
157− =<< T.replace
160+ -- =<< T.replace
158− "# config.android_sdk.accept_license = false;"
161+ -- "# config.android_sdk.accept_license = false;"
159− "config.android_sdk.accept_license = true;"
162+ -- "config.android_sdk.accept_license = true;"
160− <$> readfile defaultNixPath
163+ -- <$> readfile defaultNixPath
161− nixBuild ["-A", "android.frontend"]
164+ -- nixBuild ["-A", "android.frontend"]
163 forM_ ["ghc", "ghcjs"] $ \compiler -> do
166 forM_ ["ghc", "ghcjs"] $ \compiler -> do
@@ -236,7 +239,7 @@ main = do
236testObRunInDir :: Socket.PortNumber -> Socket.PortNumber -> Maybe Shelly.FilePath -> HTTP.Manager -> Sh ()
239testObRunInDir :: Socket.PortNumber -> Socket.PortNumber -> Maybe Shelly.FilePath -> HTTP.Manager -> Sh ()
237testObRunInDir p0 p1 mdir httpManager = handle_sh (\case ExitSuccess -> pure (); e -> throw e) $ do
240testObRunInDir p0 p1 mdir httpManager = handle_sh (\case ExitSuccess -> pure (); e -> throw e) $ do
238 let uri p = "http://localhost:" <> T.pack (show p) <> "/" -- trailing slash required for comparison
241 let uri p = "http://localhost:" <> T.pack (show p) <> "/" -- trailing slash required for comparison
239− writefile "config/common/route" $ uri p0
242+ writefile routeFile $ uri p0
240 maybe id chdir mdir $ runHandle "ob" ["run"] $ \stdout -> do
243 maybe id chdir mdir $ runHandle "ob" ["run"] $ \stdout -> do
241 firstUri <- handleObRunStdout httpManager stdout
244 firstUri <- handleObRunStdout httpManager stdout
242 let newUri = uri p1
245 let newUri = uri p1
@@ -281,10 +284,10 @@ hGetLineSkipBlanks h = liftIO $ fix $ \loop -> T.hGetLine h >>= \case
281-- | Alters the route file and waits for `ob run` to reload
284-- | Alters the route file and waits for `ob run` to reload
282alterRouteTo :: Text -> Handle -> Sh ()
285alterRouteTo :: Text -> Handle -> Sh ()
283alterRouteTo uri stdout = do
286alterRouteTo uri stdout = do
284− writefile "config/common/route" uri
287+ writefile routeFile uri
285 hGetLineSkipBlanks stdout >>= \t -> when (t /= "Reloading...") $ errorExit $
288 hGetLineSkipBlanks stdout >>= \t -> when (t /= "Reloading...") $ errorExit $
286 "Reloading failed: " <> T.pack (show t)
289 "Reloading failed: " <> T.pack (show t)
287− hGetLineSkipBlanks stdout >>= \t -> when (t /= " config/common/route") $ errorExit $
290+ hGetLineSkipBlanks stdout >>= \t -> when (t /= " " <> routeFile) $ errorExit $
288 "Reloading failed: " <> T.pack (show t)
291 "Reloading failed: " <> T.pack (show t)
289 hGetLineSkipBlanks stdout >>= \t -> when (t /= "Interrupted.") $ errorExit $
292 hGetLineSkipBlanks stdout >>= \t -> when (t /= "Interrupted.") $ errorExit $
290 "Reloading failed: " <> T.pack (show t)
293 "Reloading failed: " <> T.pack (show t)