What is the proper approach to set up multiple versions of the same project?
For example,how to set up and maintain multiple versions of the project, e.g Sales_v1, Sales_v2, etc, so that each subsequent version have additional application functionality being developed and released.
i think this is not a CUBA specific question, so the normal answers from general programming apply here. You can (and probably should) set up your project so that you are using version control. With this you can use branches for different versions e.g. (Common Branching Patterns).
To release different versions you can use the gradle’s features to describe your version number in the build.gradle:
cuba {
artifact {
group = 'com.company.software'
version = '1.0'
isSnapshot = false
}
}
Then you can use gradle’s tasks to “install” and “uploadArchives” to deploy the software artefacts to a central repository. Since you can be in different branches, you therefore can deploy different versions of the software.
Thanks Mario. I will need to spend some time on version control approach.
I was thinking of making a copy of the Cuba project folder as a simple approach but not sure if it’s advisable (for non-team development). In my use case, i just want a copy of the project to try out some additional features to be built without messing up with the original project.
Steps to make a copy of Cuba project:
Make a copy the project folder
Open the project folder copy in Cuba Studio as a new project
Create a copy of the DB for the project copy
Test built some feature in the project copy
Duplicate the feature in the original project after testing the feature in the project copy
I understand version control is the right approach but just wondering if the above will work for simple case.
well, the described situation above will work for the “simple” case without a VCS.
Basically what a version control system like git is exactly the same but with the following different advantages:
Once you are ready with your changes and want to copy it over to the original directory, git will do that with a single command (merge branch from feature-branch to master)
If you have to additionally add features to the original directory, you have to copy them over to the new directory - git will do this as well (merge branch from master to feature-branch)
you can save and restore different phases of your implementation through commits