Commit 4396ff259a540ecfe2a36f655eecfca1b97e1d4e

Authored by Arthur Bikmullin
1 parent 3158ea54

Fixed first build bug

Showing 1 changed file with 8 additions and 8 deletions
... ... @@ -64,7 +64,7 @@ Class Builder
64 64 If tcc.opt_builddir
65 65 buildPath=ExtractDir( tcc.opt_srcpath )+"/"+tcc.opt_builddir
66 66 Else
67   - buildPath=StripExt( tcc.opt_srcpath )+".build"
  67 + buildPath = StripExt( tcc.opt_srcpath )+".build"
68 68 Endif
69 69
70 70 Local targetPath:= buildPath + "/" + tcc.target.dir 'ENV_TARGET
... ... @@ -75,7 +75,7 @@ Class Builder
75 75
76 76 If FileType(buildMetaPath) = FILETYPE_FILE
77 77 buildMetaData = New JsonObject(LoadString(buildMetaPath))
78   - End
  78 + End
79 79
80 80 If FileType(targetPath) = FILETYPE_DIR
81 81 If buildMetaData
... ... @@ -107,14 +107,15 @@ Class Builder
107 107 buildMetaData = New JsonObject()
108 108 End
109 109
110   - Local targets:=JsonObject(buildMetaData.Get("targets"))
  110 + Local targets := JsonObject(buildMetaData.Get("targets"))
111 111
112 112 If Not targets
113 113 targets = New JsonObject()
114 114 buildMetaData.Set("targets", targets)
115 115 End
116 116
117   - targets.SetString(tcc.target.name, tcc.target.version)
  117 + targets.SetString(tcc.target.name, tcc.target.version)
  118 + If FileType( buildPath ) = FILETYPE_NONE CreateDir buildPath
118 119 SaveString(buildMetaData.ToJson(), buildPath + "/build.meta.json")
119 120 End
120 121
... ... @@ -126,7 +127,6 @@ Class Builder
126 127 ElseIf FileType(targetPath) <> FILETYPE_DIR 'first build
127 128 cfgPath = tcc.target.abspath + "/template/CONFIG.MONKEY"
128 129 If FileType(cfgPath) = FILETYPE_FILE PreProcess cfgPath, "", True
129   -
130 130 End
131 131
132 132 app=ParseApp( tcc.opt_srcpath )
... ... @@ -141,7 +141,7 @@ Class Builder
141 141
142 142 Print "Translating..."
143 143 Local transbuf:=New StringStack
144   - For Local file$=Eachin app.fileImports
  144 + For Local file:String = Eachin app.fileImports
145 145 If ExtractExt( file ).ToLower()=ENV_LANG
146 146 transbuf.Push LoadString( file )
147 147 transbuf.Push "~n"
... ... @@ -161,8 +161,8 @@ Class Builder
161 161 If FileType( targetPath )<>FILETYPE_NONE Die "Failed to clean target dir"
162 162 Endif
163 163
164   - If FileType( targetPath )=FILETYPE_NONE
165   - If FileType( buildPath )=FILETYPE_NONE CreateDir buildPath
  164 + If FileType( targetPath ) = FILETYPE_NONE
  165 + If FileType( buildPath ) = FILETYPE_NONE CreateDir buildPath
166 166 If FileType( buildPath )<>FILETYPE_DIR Die "Failed to create build dir: "+buildPath
167 167 If Not CopyDir(tcc.target.abspath + "/template", targetPath, True, False) Die "Failed to copy target dir"
168 168 Endif
... ...