Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about build variants to contributors guide #77

Merged
merged 24 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
_static/vid/**/* filter=lfs diff=lfs merge=lfs -text
img/**/* filter=lfs diff=lfs merge=lfs -text

# images
*.bmp filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
Expand All @@ -10,16 +9,13 @@ img/**/* filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text

# video
*.mov filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.mpeg filter=lfs diff=lfs merge=lfs -text

# audio
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text

# documents, etc.
*.doc filter=lfs diff=lfs merge=lfs -text
*.docx filter=lfs diff=lfs merge=lfs -text
Expand All @@ -28,9 +24,10 @@ img/**/* filter=lfs diff=lfs merge=lfs -text
*.pptx filter=lfs diff=lfs merge=lfs -text
*.xls filter=lfs diff=lfs merge=lfs -text
*.xlsx filter=lfs diff=lfs merge=lfs -text

# archives
*.7z filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
Tracking filter=lfs diff=lfs merge=lfs -text
33 changes: 32 additions & 1 deletion odkx-src/build-scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,45 @@ To run the UI tests:

./gradlew clean testSnapshotBasicDebug connectedSnapshotBasicDebugAndroidTest

Build Variants
~~~~~~~~~~~~~~~~~~

wbrunette marked this conversation as resolved.
Show resolved Hide resolved

ODK-X has a modular framework design with inter-dependencies between various ODK-X tools. To manage accepting code contributions, bug fixes, and other enhancements that might affect other tools in an unforeseen way ODK-X uses a 3 staged release workflow that involves 3 branches.

- development: the branch where new development, upgrades, and features are contributed and tested
- demo: This branch is the last stable version of development. This provides a staging area used for testing before moving to an official release. This is where preview releases are staged.
- master: The current stable release.

Since the branches are at different stages of development the dependency libraries are at different stages of development. To make sure you are building against the correct dependencies you need to either checkout a local copy of the dependencies using the same branch name in the same directory OR you can adjust the build variant to match the dependencies causing Gradle and Android Studio to fetch the correct dependencies when compiling.

Each build variant represents a different version of your app that You can configure a dependency for a specific build variant. https://developer.android.com/studio/build/build-variants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence does not quite make sense. Does it mean "Each build variant represents a different version of your app that you can configure a dependency for"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elmps2018 Yes it does.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revise to say that instead.


.. note::

The Build variant corresponding to the source branches:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor edit -- build should be lower case


1. **development**: **snapshotBasicRelease** is one of the build variant corresponds to development branch. All the required changes and forks are done from this branch in which the new development, upgrades, and features should be contributed and tested.
wbrunette marked this conversation as resolved.
Show resolved Hide resolved
wbrunette marked this conversation as resolved.
Show resolved Hide resolved
2. **demo**: **demoBasicRelease** here is the build variant that corresponds to demo branch . This is the preview release of an application before launching the official release. Which can be used by project maintainers for testing out the application if it is not creating any errors.
wbrunette marked this conversation as resolved.
Show resolved Hide resolved
3. **master**: **masterBasicRelease** is the official and stable release of an application, this is the latest release of ODK-X application.
wbrunette marked this conversation as resolved.
Show resolved Hide resolved

Gradle creates a build variant for every possible combination of the product flavor and build types that you configure. As different code bases is used for each flavor variant.

Steps to change build variants in Android studio:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android studio
Android Studio


1. To change the build variant Android Studio uses, select **Build** > **Select Build Variant** in the menu bar.
2. The Build Variants panel has two columns: **Module** and **Active Build Variant**. The **Active Build Variant** value for the module determines which build variant the IDE deploys to your connected device and is visible in the editor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is IDE? might need to define this acronym.


.. image:: /img/survey-using/build-variants.*
:alt: "Change build variant"
:class: device-screen-vertical

.. _build-scripts-internal:

Internal Build Files
------------------------

This section covers the files that are stored inside each of the Android projects. These paths follow the same pattern for each Android project, just the project name differs. For clarity, the root level of the project will be referred to as :file:`root` and the app/lib level of the project will be referred to as :file:`app`. So, for example, the path :file:`services/services_app/build.gradle` becomes :file:`project/app/build.gradle`.
This section covers the files that are stored inside each of the Android projects. These paths follow the same pattern for each Android project, the project name differs. For clarity, the root level of the project will be referred to as :file:`root` and the app/lib level of the project will be referred to as :file:`app`. So, for example, the path :file:`services/services_app/build.gradle` becomes :file:`project/app/build.gradle`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just or something similar should be here, "each Android project, the project name differs" does not scan.


.. _build-scripts-internal-settings:

Expand Down
3 changes: 3 additions & 0 deletions odkx-src/img/survey-using/build-variants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions odkx-src/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ esthetics
ethiopian
extensibility
fallback
flavor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flavor should not need to be added to the list. It was a style check problem disliking the usage of "flavour" in favor of "flavor".

fiducial
firebase
Firebase
Expand Down