@@ -40,16 +40,20 @@ let cleanDirs dirs =
4040 for dir in dirs do
4141 removeDirRecursive dir
4242
43- let updateVersionInCliUtil () =
43+ let updateVersionInCliUtil version =
4444 let filePath = " src/Fable.Cli/Util.fs"
45- let version = Publish.loadReleaseVersion " src/Fable.Cli"
4645 // printfn "VERSION %s" version
4746 Regex.Replace(
4847 readFile filePath,
4948 @" let \[<Literal>] VERSION = "" .*?"" " ,
5049 sprintf " let [<Literal>] VERSION = \" %s \" " version)
5150 |> writeFile filePath
5251
52+ let updatePkgVersionInFsproj projFile version =
53+ readFile projFile
54+ |> replaceRegex Publish.NUGET_ PACKAGE_ VERSION [ " $1" ; version; " $3" ]
55+ |> writeFile projFile
56+
5357let downloadAndExtractTo ( url : string ) ( targetDir : string ) =
5458 sprintf " npx download --extract --out %s \" %s \" " targetDir url |> run
5559
@@ -77,6 +81,7 @@ let buildLibrary() =
7781 runFableWithArgs projectDir [
7882 " --outDir " + buildDir
7983 " --fableLib " + buildDir
84+ " --noCache"
8085 " --exclude Fable.Core"
8186 " --define FX_NO_BIGINT"
8287 ]
@@ -117,6 +122,7 @@ let buildLibraryTs() =
117122 runFableWithArgs projectDir [
118123 " --outDir " + buildDirTs
119124 " --fableLib " + buildDirTs
125+ " --noCache"
120126 " --typescript"
121127 " --exclude Fable.Core"
122128 " --define FX_NO_BIGINT"
@@ -135,7 +141,7 @@ let quicktest () =
135141 if pathExists quicktestJsPath |> not then
136142 writeFile quicktestJsPath " console.log('Getting ready, hold tight')"
137143
138- run " dotnet watch -p src/Fable.Cli run -- watch --cwd ../quicktest --exclude Fable.Core --forcePkgs --runScript"
144+ run " dotnet watch -p src/Fable.Cli run -- watch --cwd ../quicktest --exclude Fable.Core --noCache --runScript"
139145
140146let buildStandalone ( minify : bool ) =
141147 printfn " Building standalone%s ..." ( if minify then " " else " (no minification)" )
@@ -155,8 +161,7 @@ let buildStandalone(minify: bool) =
155161 // build standalone bundle
156162 runFableWithArgs projectDir [
157163 " --outDir " + buildDir + " /bundle"
158- " --fableLib " + libraryDir
159- " --forcePkgs"
164+ " --noCache"
160165 " --define FX_NO_CORHOST_SIGNER"
161166 " --define FX_NO_LINKEDRESOURCES"
162167 " --define FX_NO_PDB_READER"
@@ -171,8 +176,7 @@ let buildStandalone(minify: bool) =
171176 // build standalone worker
172177 runFableWithArgs ( projectDir + " /Worker" ) [
173178 " --outDir " + buildDir + " /worker"
174- " --fableLib " + libraryDir
175- " --forcePkgs"
179+ " --noCache"
176180 ]
177181
178182 // make standalone bundle dist
@@ -215,7 +219,6 @@ let buildStandalone(minify: bool) =
215219
216220let buildCompilerJs ( minify : bool ) =
217221 let projectDir = " src/fable-compiler-js/src"
218- let libraryDir = " build/fable-library"
219222 let buildDir = " build/fable-compiler-js"
220223 let distDir = " src/fable-compiler-js/dist"
221224
@@ -227,8 +230,7 @@ let buildCompilerJs(minify: bool) =
227230
228231 runFableWithArgs projectDir [
229232 " --outDir " + buildDir
230- " --fableLib " + libraryDir
231- " --forcePkgs"
233+ " --noCache"
232234 " --exclude Fable.Core"
233235 ]
234236
@@ -277,8 +279,7 @@ let test() =
277279
278280 runFableWithArgs projectDir [
279281 " --outDir " + buildDir
280- " --fableLib " + libraryDir
281- " --forcePkgs"
282+ " --noCache"
282283 " --exclude Fable.Core"
283284 ]
284285
@@ -290,37 +291,30 @@ let test() =
290291
291292let testRepos () =
292293 let repos = [
293- " https://github.com/alfonsogarciacaro/Fable.Jester:nagareyama"
294+ " https://github.com/alfonsogarciacaro/Fable.Jester:nagareyama" , " npm i && npm test"
295+ " https://github.com/Zaid-Ajaj/Fable.SimpleJson:master" , " npm i && npm run test-nagareyama"
294296 ]
295297
296- // Make sure we don't install a cached version
297- let removeCachedPackage () =
298- run " rm -rf ~/.nuget/packages/fable"
299- // run "dotnet nuget locals all --clear"
300-
301- let fableVersionRange = " 3.0.0-nagareyama-*"
298+ let version = " 3.0.0-local-build-" + DateTime.Now.ToString( " yyyyMMdd-HHmm" )
302299 let testDir = " temp"
303300 let pkgDir = " pkg"
301+
304302 cleanDirs [ testDir]
305303 makeDirRecursive testDir
306-
307- removeCachedPackage ()
304+ updateVersionInCliUtil version
305+ updatePkgVersionInFsproj " src/Fable.Cli/Fable.Cli.fsproj " version
308306 run ( sprintf " dotnet pack src/Fable.Cli/ -p:Pack=true -c Release -o %s " ( testDir </> pkgDir))
309307
310- for repo in repos do
308+ for ( repo, command ) in repos do
311309 let url , branch = let i = repo.LastIndexOf( " :" ) in repo.[.. i-1 ], repo.[ i+ 1 ..]
312310 let name = url.[ url.LastIndexOf( " /" ) + 1 ..]
313311 runInDir testDir ( sprintf " git clone %s %s " url name)
314312 let repoDir = testDir </> name
315313 runInDir repoDir ( " git checkout " + branch)
316314 runInDir repoDir " dotnet tool uninstall fable"
317315 runInDir repoDir ( sprintf " dotnet tool install fable --version \" %s \" --add-source %s "
318- fableVersionRange ( " .." </> pkgDir))
319- runInDir repoDir " dotnet tool restore"
320- runInDir repoDir " npm install" // yarn
321- runInDir repoDir " npm test"
322-
323- removeCachedPackage()
316+ version ( " .." </> pkgDir))
317+ runInDir repoDir command
324318
325319let coverage () =
326320 // report converter
@@ -422,10 +416,11 @@ let syncFcsRepo() =
422416 copyFcsRepo FCS_ REPO_ LOCAL
423417
424418let packages =
425- [ " Fable.Cli" , ( fun () ->
426- updateVersionInCliUtil()
427- buildLibrary())
419+ [ " Fable.AST" , doNothing
428420 " Fable.Core" , doNothing
421+ " Fable.Cli" , ( fun () ->
422+ Publish.loadReleaseVersion " src/Fable.Cli" |> updateVersionInCliUtil
423+ buildLibrary())
429424 " fable-compiler-js" , fun () -> buildCompilerJs true
430425 " fable-metadata" , doNothing
431426 " fable-publish-utils" , doNothing
0 commit comments