You are here

commandline build | Cypress Semiconductor

commandline build

Summary: 6 Replies, Latest post by noppel_1763231 on 14 Oct 2016 01:00 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
noppel_1763231's picture
User
4 posts

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

hli
user_78878863's picture
User
2585 posts

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.

noppel_1763231's picture
User
4 posts

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)

hli
user_78878863's picture
User
2585 posts

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

noppel_1763231's picture
User
4 posts

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?

hli
user_78878863's picture
User
2585 posts

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.

noppel_1763231's picture
User
4 posts

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

Log in to post new comments.