commandline build

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hey everyone,

   

i figered out how to build a psoc 3.3 project from the commandline. But now i wonder how to inject macros from the commandline. eg. -DMAJOR_VERSION=2

   

Do you have any idea how to do this. It is quit important for setting up nightly builds and release builds with jenkins.

   

Best regards

0 Likes
6 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

It should be '-D MAJOR_VERSION=2'. Look at the project build settings - there you can see the complete command line. And under compiler/general you can add preprocessor defines.

0 Likes
Anonymous
Not applicable

To call the compiler you suggestion would work. But i call psoc directly via:

   

"C:\Program Files (x86)\Cypress\PSoC Creator\3.3\PSoC Creator\bin\cyprjmgr.exe" -wrk "ArgaveSubcontroller.cywrk" -D MAJOR_VERION=2 -build

   

And im getting the following error.

   

Error: mgr.M0004: The option -D is invalid (App=cyprjmgr)
Error: mgr.M0027: There is invalid option (App=cyprjmgr)

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think cyprjmgr will look at you the build settings in your workspace. So try to set it there (via Creator).

0 Likes
Anonymous
Not applicable

How should i edit settings via creator in a jenkins build? I may generate a settings.h file an include it in the source but that seems a bit hacky, doesnt it? Does any got a better idea?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Sorry, I missed the Jenkins requirement. (And I think that setting the major version is not a task for the CI system).

   

I think you cannot do that. Best way is probably to add all generated code to the SCM, and then only run the actual C compiler steps. There you can add the -D parameters.

0 Likes
Anonymous
Not applicable

Hi hli,

   

where do you set versions? We use the jenkins release plugin to set major, minor and patchversion and also the releasetype (nightly, alpha, beta, rc, release). This gives us an defined environment for those builds and all build logs are automatically saved. Builds running on developer-machines are not getting any version. (v0.0.0-dev)

   

Do you tag your SCM revision and build releases on those? We get our revisions tagged by Jenkins if we trigger an releasebuild.

   

By changing the build settings, a developer needs to remember to tag the revision with the same version he has set in the build settings. This may lead to mistakes.

   

Would be nice to hear your opinion about this one. Maybe i can find a better solution with building psoc-project releases.

   

 

   

Best regards,

   

noppel

0 Likes