Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
26 changes: 5 additions & 21 deletions .github/workflows/commcare-android-pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,13 @@ jobs:
uses: actions/checkout@v6
with:
path: commcare-android
- name: Install python
if: ${{ github.event_name == 'pull_request' }}
uses: actions/setup-python@v6
with:
python-version: '3.9'
- name: Download cross request script
if: ${{ github.event_name == 'pull_request' }}
run: |
curl https://raw.githubusercontent.com/dimagi/mobile-deploy/master/requirements.txt -o requirements.txt
curl https://raw.githubusercontent.com/dimagi/mobile-deploy/master/checkout_cross_request_repo.py -o checkout_cross_request_repo.py
- name: Install Python dependencies
if: ${{ github.event_name == 'pull_request' }}
run: python -m pip install -r requirements.txt
- name: Run cross request script
if: ${{ github.event_name == 'pull_request' }}
run: python checkout_cross_request_repo.py commcare-android ${{ github.event.number }} commcare-core
submodules: true
- name: Checkout commcare-core for cross-repo CI
if: ${{ inputs.commcare_core_sha }}
uses: actions/checkout@v6
with:
repository: dimagi/commcare-core
ref: ${{ inputs.commcare_core_sha }}
path: commcare-core
run: |
cd commcare-android/libs/commcare-core
git fetch origin ${{ inputs.commcare_core_sha }}
git checkout ${{ inputs.commcare_core_sha }}
- name: Generate GitHub App token
if: ${{ always() && inputs.commcare_core_check_name && inputs.commcare_core_sha }}
id: app-token
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "libs/commcare-core"]
path = libs/commcare-core
url = https://github.com/dimagi/commcare-core.git
branch = master
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This task auto-formats the file and then verifies it is clean. If any violations
- Instrumentation tests: `app/instrumentation-tests/`

## Project Structure Notes
- CommCare Core is in `../commcare-core/`, always include it to the working directory for the current session
- CommCare Core is in `libs/commcare-core/` (a git submodule), always include it to the working directory for the current session
- Connect and PersonalID share `org.commcare.connect` package
- PersonalID Fragments are in `org.commcare.fragments.personalId` package
- This is a multi-module Android project. When asked to find a file or class, search across all modules (commcare-android, commcare-core, commcare-support-library) rather than assuming the default module.
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ Go ahead and open Android Studio if this is your first time using it;
it may take you through some sort of setup wizard, and it's nice to get that out of the way. If it's not the first time, ensure that there are no references to [removed Java options](https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#removed-java-options) in your environment, most commonly found are *MaxPermSize* and *PermSize*

Android Studio's default project space is `~/AndroidStudioProjects` so I'm going to use that in the example.
CommCare Android depends on CommCare Core, and CommCare Android expects the core directory to live side by side
in your directory structure. You can acheive this with the following commands (in Bash):
CommCare Android includes CommCare Core as a git submodule. Clone with:

```bash
cd ~/AndroidStudioProjects
mkdir CommCare
cd CommCare
git clone https://github.com/dimagi/commcare-android.git
git clone https://github.com/dimagi/commcare-core.git
git clone --recurse-submodules https://github.com/dimagi/commcare-android.git
```

If you already cloned without `--recurse-submodules`, run:
```bash
git submodule update --init
```

- Open Android Studio
Expand Down
9 changes: 0 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens

////////////
// README //
////////////

// This build script assumes the following directory structure:
// - somewhere/your/code/directory/is
// -- commcare-android (github: https://github.com/dimagi/commcare-android/)
// -- commcare-core (github: https://github.com/dimagi/commcare-core/)
// these directories MUST be named like this, or it won't work

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private static void initFactoryClassList() {
+ "/intermediates/javac/commcareDebug/compileCommcareDebugJavaWithJavac/classes/"
, BuildConfig.BUILD_DIR + "/intermediates/javac/commcareDebug/classes/"
, BuildConfig.BUILD_DIR + "/tmp/kotlin-classes/commcareDebug/"};
String baseCC = BuildConfig.PROJECT_DIR + "/../../commcare-core/build/classes/java/main/";
String baseCC = BuildConfig.PROJECT_DIR + "/../libs/commcare-core/build/classes/java/main/";


for(String variant : baseODK) {
Expand Down
1 change: 1 addition & 0 deletions libs/commcare-core
Submodule commcare-core added at 25fc5e
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ':app'
include ':commcare-core'
include ':commcare-support-library'
project(':commcare-core').projectDir = new File('../commcare-core')
project(':commcare-core').projectDir = new File('libs/commcare-core')
Loading