- 
                Notifications
    
You must be signed in to change notification settings  - Fork 48
 
Run selected checkoutScripts in build-only mode #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Get a bit more coverage.
Newer powershell versions warn if the "-Depth" parameter truncates the encoded JSON: WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2. Suppress this warning because it is expected behaviour.
By default no checkout scripts are run when building with --build-only. Some use cases practically require the checkoutScript to be always run, through. A typical example are code generators that generate sources from some high level description. These generators must be run every time when the user has changed the input. A recipe or class can explicitly opt in to run their checkoutScript also in build-only mode to cover such a use case. This is done by either setting checkoutUpdateIf to True or by a boolean expression that is evaluated to True. Otherwise the checkoutScript is ignored even if some other class enables its script. The checkoutUpdateIf property thus only applies to the corresponding checkoutScript in the same recipe/class. The build logic already did support the import SCM which was run in build-only mode too. Unify the handling of the import SCM with the selective enabling of checkoutScript's on build-only builds. Fixes BobBuildTool#452.
          Codecov ReportBase: 86.24% // Head: 86.39% // Increases project coverage by  
 Additional details and impacted files@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
+ Coverage   86.24%   86.39%   +0.15%     
==========================================
  Files          46       46              
  Lines       14202    14219      +17     
==========================================
+ Hits        12248    12285      +37     
+ Misses       1954     1934      -20     
 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov.  | 
    
| 
           I did some simple tests and it looks good to me. Just to get it right - atm we have something like: checkoutSCM:
 scm: url
 url: foo
 extract: false
checkoutScript: |
  extract foo
buildScript: |
  run_gen $1/foo
  build..Now with the  checkoutSCM:
 scm: url
 url: foo
 extract: false
checkoutUpdateIf: True
checkoutScript: |
  if  [ foo_has_changed ]; then
     extract foo
  fi
  run_gen .
buildScript: |
  build ..Is there any possibility to avoid the need of a custom   | 
    
          
 Actually I have already thought about something along these lines. The thing is, it is usually not needed to know. The checkout script can be re-run at any time. The user could add   | 
    
| 
           Hmm...I think you're right. If   | 
    
By default no checkout scripts are run when building with
--build-only.Some use cases practically require the
checkoutScriptto be always run,through. A typical example are code generators that generate sources
from some high level description. These generators must be run every
time when the user has changed the input. A recipe or class can
explicitly opt in to run their
checkoutScriptalso in build-only mode tocover such a use case. This is done by either setting
checkoutUpdateIfto
Trueor by a boolean expression that is evaluated toTrue. Otherwisethe
checkoutScriptis ignored even if some other class enables itsscript. The
checkoutUpdateIfproperty thus only applies to thecorresponding
checkoutScriptin the same recipe/class.