11# Sample plugin to modify path name calculation
22#
33# This plugin introduces two new properties to a recipe:
4- # - checkoutDir : optional string that is appended to the source directory
5- # - platform : optional string that is appenden to the build and dist directories
4+ # - CheckoutDir : optional string that is appended to the source directory
5+ # - Platform : optional string that is appenden to the build and dist directories
66
77from os .path import join
88from bob .errors import ParseError
99from bob .input import PluginState , PluginProperty
1010
1111def commonFormatter (step , states ):
12- s = states ['pathFmt ' ]
12+ s = states ['PathFmt ' ]
1313 if step .isCheckoutStep ():
1414 base = step .getPackage ().getRecipe ().getName ()
1515 ext = s .getCheckoutDir ()
@@ -35,15 +35,15 @@ def __init__(self):
3535 self .__platformDir = None
3636
3737 def onEnter (self , env , properties ):
38- # checkoutDir is always taken from current recipe
39- self .__checkoutDir = properties ['checkoutDir ' ].getValue ()
38+ # CheckoutDir is always taken from current recipe
39+ self .__checkoutDir = properties ['CheckoutDir ' ].getValue ()
4040 if self .__checkoutDir is not None :
41- self .__checkoutDir = env .substitute (self .__checkoutDir , "checkoutDir " )
41+ self .__checkoutDir = env .substitute (self .__checkoutDir , "CheckoutDir " )
4242
43- # platform is passed down to dependencies
44- platform = properties ['platform ' ]
43+ # Platform is passed down to dependencies
44+ platform = properties ['Platform ' ]
4545 if platform .isPresent ():
46- self .__platformDir = env .substitute (platform .getValue (), "platform " )
46+ self .__platformDir = env .substitute (platform .getValue (), "Platform " )
4747
4848 def getCheckoutDir (self ):
4949 return self .__checkoutDir
@@ -66,10 +66,10 @@ def validate(data):
6666 'jenkinsNameFormatter' : jenkinsFormatter
6767 },
6868 'properties' : {
69- "checkoutDir " : StringProperty ,
70- "platform " : StringProperty
69+ "CheckoutDir " : StringProperty ,
70+ "Platform " : StringProperty
7171 },
7272 'state' : {
73- "pathFmt " : PathFmtState
73+ "PathFmt " : PathFmtState
7474 }
7575}
0 commit comments