Thanks for wanting to contribute source code to Nextcloud. That's great!
New contributions are added under AGPL version 3.
We are all about quality while not sacrificing speed so we use a very pragmatic workflow.
master
branchmaster
2.0.0
) or bugfix (e.g. 2.0.1
) release will be backported to the respective bugfix branch (e.g. 2.0.x
or 2.1.x
)Our formatter setup is rather simple:
There are three build variants
git commit -a
git push
To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/master.
* ```git checkout -b my_new_master_branch upstream/master```
* If you want to rename that branch later: ```git checkout -b my_new_master_branch_with_new_name```
* Push branch to server: ```git push -u origin name_of_local_master_branch```
* Use GitHub to issue PR
### 4. Backport pull request:
Use backport-bot via "/backport to stable-version", e.g. "/backport to stable-3.7".
This will automatically add "backport-request" label to PR and bot will create a new PR to targeted branch once the base PR is merged.
If automatic backport fails, it will create a comment.
### 5. Pull requests that also need changes on library
For speeding up developing, we do use a master snapshot of nextcloud-library, provided by jitpack.io.
This means that if a breaking change is merged on library, master branch of the app will fail.
To limit this risk please follow this approach:
- on app PR: first use a reference to your library branch in build.gradle: ext -> androidLibraryVersion, e.g. androidLibraryVersion = "changeSearch-SNAPSHOT"
- on library PR: use label "client change required" to indicate that this is breaking change. This will prevent GitHub from merging it.
Once both PRs are reviewed and ready to merge:
- on library PR: remove label and merge it (for a short time now master cannot be built!)
- on app PR: change androidLibraryVersion back to "master-SNAPSHOT"
- wait for CI and then merge
With this approach the "downtime" of not building master is limited to the timestamp between merge lib PR and merging app PR, which is only limited by CI.
### 6. Adding new files
If you create a new file it needs to contain a license header. We encourage you to use the same license (AGPL3+) as we do.
Copyright of Nextcloud GmbH is optional.
Source code of library:
java
/* Nextcloud Android Library is available under MIT license *
THE SOFTWARE. * */
Source code of app:
java
/*
along with this program. If not, see https://www.gnu.org/licenses/. */
XML (layout) file:
xml
```
The file naming patterns are inspired and based on Ribot's Android Project And Code Guidelines.
Similar to layout files, menu files should match the name of the component. For example, if we are defining a menu file that is going to be used in the UserProfileActivity
, then the name of the file should be activity_user_profile.xml
. Same pattern applies for menus used in adapter view items, dialogs, etc.
Component | Class Name | Menu Name |
---|---|---|
Activity | UserProfileActivity |
activity_user_profile.xml |
Fragment | SignUpFragment |
fragment_sign_up.xml |
Dialog | ChangePasswordDialog |
dialog_change_password.xml |
AdapterView item | --- | item_person.xml |
Partial layout | --- | partial_stats_bar.xml |
A good practice is to not include the word menu
as part of the name because these files are already located in the menu
directory. In case a component uses several menus in different places (via popup menus) then the resource name would be extended. For example, if the user profile activity has two popup menus for configuring the users settings and one for the handling group assignments then the file names for the menus would be: activity_user_profile_user_settings.xml
and activity_user_profile_group_assignments.xml
.
We manage translations via Transifex. So just request joining the translation team for Android on the site and start translating. All translations will then be automatically pushed to this repository, there is no need for any pull request for translations.
If you need to change a translation, do not change it, but give it new key. This way the translation stays backward compatible as we automatically backport translated strings to last versions.
When submitting PRs with changed translations, please only submit changes to values/strings.xml and not changes to translated files. These will be overwritten by next merge of transifex-but and increase PR review.
At the moment we are releasing the app in two app stores:
We do differentiate between three different kinds of releases:
Play store and f-droid releases for the masses. Pull Requests that have been tested and reviewed can go to master. After the last release candidate is out in the wild for ~2 weeks and no errors get reported (by users or in the developer console) the master branch is ready for the stable release. So when we decide to go for a new release we freeze the master feature wise.
stable beta releases done via the Beta program of the Google Play store and f-droid. Whenever a PR is reviewed/approved we put it on master. Before releasing a new stable version there is at least one release candidate. It is based on the current master and during this phase the master is feature freezed. After ~2 weeks with no error a stable version will be released, which is identical to the latest release candidate.
Done as a standalone app that can be installed in parallel to the stable app. Any PR which is labelled "ready for dev" will be automatically included in the dev app. This label should only set by the main developers. Same applies for the android-library. This repository also has a branch called dev which includes all upcoming features. The dev branch on this repository must always use the android-library dev branch.
For stable and release candidate the version name follows the semantic versioning schema and the version number has several digits reserved to parts of the versioning schema inspired by the jayway version numbering, where:
Examples for different versions:
10000099
80120200
90080418
beware, that beta releases for an upcoming version will always use the minor and hotfix version of the release they are targeting. So to make sure the version code of the upcoming stable release will always be higher stable releases set the 2 beta digits to '99' as seen above in the examples.
For dev the version name is in format YYYYMMDD. It is mainly as a reference for reporting bugs and is not related to stable/release candidates as it is an independent app.
Hotfixes as well as security fixes are released via bugfix releases (dot releases) but are released on demand in contrast to regular, scheduled bugfix releases.
To get an idea which PRs and issues will be part of the next release simply check our milestone plan
Stable releases are based on the git master.
stable-Mayor.Minor.Hotfix
(e.g. stable-1.2.0) naming the version number following the semantic versioning schemaRelease Candidate releases are based on the git master and are done between stable releases.
rc-Mayor.Minor.Hotfix-betaIncrement
(e.g. rc-1.2.0-12) naming the version number following the semantic versioning schemaDev releases are based on the master branch and are done independently from stable releases for people willing to test new features and provide valuable feedback on new features to be incorporated before a feature gets released in the stable app.
The deployment/build is done once a day automatically. If code has changed a new apk will be published here and it will, with a little delay, be available on Fdroid.