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

[#503] Deprecate the XML template #519

Merged
merged 11 commits into from
Oct 16, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions .github/workflows/review_pull_request.yml
luongvo marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

# template-xml

- name: Run Detekt on template-xml
working-directory: ./template-xml
run: ./gradlew detekt

- name: Run Android Lint on template-xml
working-directory: ./template-xml
run: ./gradlew lint

- name: Run unit tests with Kover on template-xml
working-directory: ./template-xml
run: ./gradlew koverXmlReport

# template-compose

- name: Run Detekt on template-compose
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/run_detekt_and_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,50 +50,6 @@ jobs:
name: CodeCoverageReportsTemplateCompose
path: template-compose/app/build/reports/kover/

# template-xml

- name: Run Detekt on template-xml
working-directory: ./template-xml
run: ./gradlew detekt

- name: Archive Detekt reports on template-xml
uses: actions/upload-artifact@v3
with:
name: DetektReportsTemplateXML
path: template-xml/build/reports/detekt/

- name: Run unit tests with Kover on template-xml
working-directory: ./template-xml
run: ./gradlew koverHtmlReport

- name: Archive code coverage reports on template-xml
uses: actions/upload-artifact@v3
with:
name: CodeCoverageReportsTemplateXML
path: template-xml/app/build/reports/kover/

# sample-xml

- name: Run Detekt on sample-xml
working-directory: ./sample-xml
run: ./gradlew detekt

- name: Archive Detekt reports on sample-xml
uses: actions/upload-artifact@v3
with:
name: DetektReportsTemplateXML
path: sample-xml/build/reports/detekt/

- name: Run unit tests with Kover on sample-xml
working-directory: ./sample-xml
run: ./gradlew koverHtmlReport

- name: Archive code coverage reports on sample-xml
uses: actions/upload-artifact@v3
with:
name: CodeCoverageReportsTemplateXML
path: sample-xml/app/build/reports/kover/

# sample-compose

- name: Run Detekt on sample-compose
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/verify_newproject_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
sdk install kscript $kscriptVersion
echo $PATH >> $GITHUB_PATH

- name: Verify generating new project from template-xml
working-directory: scripts
run: kscript new_project.kts package-name=co.myxmlproject.example app-name="My XML Project" template=xml

- name: Verify generating new project from template-compose
working-directory: scripts
run: kscript new_project.kts package-name=co.mycomposeproject.example app-name="My Compose Project" template=compose
Expand Down
4 changes: 0 additions & 4 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ end
# Show Danger test coverage report from Kover for templates
# Report coverage of modified files, warn if total project coverage is under 80%
# or if any modified file's coverage is under 95%
kover_file_template_xml = "template-xml/app/build/reports/kover/report.xml"
markdown "## Kover report for template-xml:"
shroud.reportKover "Template - XML Unit Tests", kover_file_template_xml, 80, 95, false

kover_file_template_compose = "template-compose/app/build/reports/kover/report.xml"
markdown "## Kover report for template-compose:"
shroud.reportKover "Template - Compose Unit Tests", kover_file_template_compose, 80, 95, false
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

A collection of our Android templates:

- XML template: **[template-xml](https://github.com/nimblehq/android-templates/tree/develop/template-xml)**
- Compose template: **[template-compose](https://github.com/nimblehq/android-templates/tree/develop/template-compose)**
- [Deprecated] XML template: **[template-xml](https://github.com/nimblehq/android-templates/tree/develop/deprecated/template-xml)**

## Prerequisites

Expand All @@ -28,23 +28,23 @@ A collection of our Android templates:
```
package-name= New package name (i.e., com.example.package)
app-name= New app name (i.e., MyApp, "My App", "my-app")
template= Template (i.e., xml, compose)
template= Template (i.e., compose) (optional, default: compose)
force= Force project creation even if the script fails (default: false)
destination= Set the output location where the project should be generated (i.e., /Users/johndoe/documents/projectfolder)
```

Examples:

```
kscript new_project.kts package-name=co.myxmlproject.example app-name="My XML Project" template=xml
kscript new_project.kts package-name=co.mycomposeproject.example app-name="My Compose Project"
```

```
kscript scripts/new_project.kts package-name=co.myxmlproject.example app-name="My XML Project" template=xml
kscript scripts/new_project.kts package-name=co.mycomposeproject.example app-name="My Compose Project" template=compose
```

```
kscript new_project.kts package-name=co.myxmlproject.example app-name="My XML Project" template=xml destination=/Users/johndoe/documents/projectfolder
kscript new_project.kts package-name=co.mycomposeproject.example app-name="My Compose Project" template=compose destination=/Users/johndoe/documents/projectfolder
```

4. Update `android_version_code` and `android_version_name` in `template/build.gradle`
Expand Down
33 changes: 0 additions & 33 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,12 @@ definitions:
name: Run detekt on template-compose
working_directory: ./template-compose
script: ./gradlew detekt
- &detekt_on_template_xml
name: Run detekt on template-xml
working_directory: ./template-xml
script: ./gradlew detekt
- &unit_test_on_template_compose
name: Run unit tests on template-compose
working_directory: ./template-compose
script: ./gradlew koverHtmlReport
- &unit_test_on_template_xml
name: Run unit tests on template-xml
working_directory: ./template-xml
script: ./gradlew koverHtmlReport
artifacts:
- &artifacts_template_compose template-compose/app/build/reports/kover/
- &artifacts_template_xml template-xml/app/build/reports/kover/
- &artifacts_staging_apk template-compose/app/build/outputs/apk/staging/debug/app-staging-debug.apk
- &artifacts_production_apk template-compose/app/build/outputs/apk/production/debug/app-production-debug.apk
workflows:
Expand Down Expand Up @@ -56,30 +47,6 @@ workflows:
artifacts:
- *artifacts_template_compose

unit-test-on-pr-for-template-xml:
name: Unit test on PR for template-xml
<<: *configure_environment
triggering:
events:
# Run when a pull request is opened or updated
- pull_request
branch_patterns:
# Review changes BEFORE they’re merged into any branches
- pattern: '*'
source: false
# Will not run on develop branch as it is already covered by build-and-deploy-template-compose-staging
- pattern: 'develop'
include: false
# Will not run on main branch as it is already covered by build-and-deploy-template-compose-production
- pattern: 'main'
include: false
cancel_previous_builds: true
scripts:
- *detekt_on_template_xml
- *unit_test_on_template_xml
artifacts:
- *artifacts_template_xml

build-and-deploy-template-compose-staging:
name: Build and deploy template-compose staging to Firebase App Distribution
<<: *configure_environment
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading