on master help sign in
Fix selftest for android builds by accepting license
commit137f2a27c4bf83e12331f04277c87fff999c5b33 authorElliot Cameron <eacameron@gmail.com> dateWed 18 Dec 2019, 14:10 (7 years ago) parent8f961de
1 file changed+8−1
lib/selftest/src/Obelisk/SelfTest.hs+8−1
lib/selftest/src/Obelisk/SelfTest.hs+8−1
@@ -151,7 +151,14 @@ main = do
151151
152152 if os == "darwin"
153153 then it "can build ios" $ inTmpObInit $ \_ -> nixBuild ["-A", "ios.frontend"]
154− else it "can build android" $ inTmpObInit $ \_ -> nixBuild ["-A", "android.frontend"]
154+ else it "can build android after accepting license" $ inTmpObInit $ \dir -> do
155+ let defaultNixPath = dir </> ("default.nix" :: Shelly.FilePath)
156+ writefile defaultNixPath
157+ =<< T.replace
158+ "# config.android_sdk.accept_license = false;"
159+ "config.android_sdk.accept_license = true;"
160+ <$> readfile defaultNixPath
161+ nixBuild ["-A", "android.frontend"]
155162
156163 forM_ ["ghc", "ghcjs"] $ \compiler -> do
157164 let