@@ -144,7 +144,7 @@ func compileFileWithRecipe(sourcePath string, source string, buildPath string, b
144
144
return "" , i18n .WrapError (err )
145
145
}
146
146
147
- objIsUpToDate , err := ObjFileIsUpToDate (properties [constants .BUILD_PROPERTIES_SOURCE_FILE ], properties [constants .BUILD_PROPERTIES_OBJECT_FILE ], filepath .Join (buildPath , relativeSource + ".d" ), debugLevel , logger )
147
+ objIsUpToDate , err := BuildResultIsUpToDate (properties [constants .BUILD_PROPERTIES_SOURCE_FILE ], properties [ constants . BUILD_PROPERTIES_OBJECT_FILE ], properties [constants .BUILD_PROPERTIES_OBJECT_FILE ], filepath .Join (buildPath , relativeSource + ".d" ), debugLevel , logger )
148
148
if err != nil {
149
149
return "" , i18n .WrapError (err )
150
150
}
@@ -161,25 +161,26 @@ func compileFileWithRecipe(sourcePath string, source string, buildPath string, b
161
161
return properties [constants .BUILD_PROPERTIES_OBJECT_FILE ], nil
162
162
}
163
163
164
- func ObjFileIsUpToDate (sourceFile , objectFile , dependencyFile string , debugLevel int , logger i18n.Logger ) (bool , error ) {
164
+ func BuildResultIsUpToDate (sourceFile , resultFile , objectFile , dependencyFile string , debugLevel int , logger i18n.Logger ) (bool , error ) {
165
165
sourceFile = filepath .Clean (sourceFile )
166
+ resultFile = filepath .Clean (resultFile )
166
167
objectFile = filepath .Clean (objectFile )
167
168
dependencyFile = filepath .Clean (dependencyFile )
168
169
169
170
if debugLevel >= 20 {
170
- logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "Checking previous results for {0} (result = {1}, dep = {2})" , sourceFile , objectFile , dependencyFile )
171
+ logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "Checking build results for {0} (result = {1}, dep = {2})" , sourceFile , objectFile , dependencyFile )
171
172
}
172
173
173
174
sourceFileStat , err := os .Stat (sourceFile )
174
175
if err != nil {
175
176
return false , i18n .WrapError (err )
176
177
}
177
178
178
- objectFileStat , err := os .Stat (objectFile )
179
+ resultFileStat , err := os .Stat (resultFile )
179
180
if err != nil {
180
181
if os .IsNotExist (err ) {
181
182
if debugLevel >= 20 {
182
- logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "Not found: {0}" , objectFile )
183
+ logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "Not found: {0}" , resultFile )
183
184
}
184
185
return false , nil
185
186
} else {
@@ -199,9 +200,9 @@ func ObjFileIsUpToDate(sourceFile, objectFile, dependencyFile string, debugLevel
199
200
}
200
201
}
201
202
202
- if sourceFileStat .ModTime ().After (objectFileStat .ModTime ()) {
203
+ if sourceFileStat .ModTime ().After (resultFileStat .ModTime ()) {
203
204
if debugLevel >= 20 {
204
- logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "{0} newer than {1}" , sourceFile , objectFile )
205
+ logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "{0} newer than {1}" , sourceFile , resultFile )
205
206
}
206
207
return false , nil
207
208
}
@@ -259,9 +260,9 @@ func ObjFileIsUpToDate(sourceFile, objectFile, dependencyFile string, debugLevel
259
260
}
260
261
return false , nil
261
262
}
262
- if depStat .ModTime ().After (objectFileStat .ModTime ()) {
263
+ if depStat .ModTime ().After (resultFileStat .ModTime ()) {
263
264
if debugLevel >= 20 {
264
- logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "{0} newer than {1}" , row , objectFile )
265
+ logger .Fprintln (os .Stdout , constants .LOG_LEVEL_DEBUG , "{0} newer than {1}" , row , resultFile )
265
266
}
266
267
return false , nil
267
268
}
0 commit comments