ionic-team / ionic-team/trapeze

How to delete a resource file for Android?

Open
#207 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
377
Forks
50
Avg merge
1m
Merged PRs (30d)
1

Description

Does Trapeze have a built-in way to delete resource files from an Android project? I only see a way to add files.

Some background

We're in the process of migrating from Cordova to Capacitor, and are using Trapeze to allow us to tweak the native projects for different environments. When building a local development version of our Android against a developer's local backend services, we add a network_security_config.xml and custom CA so that our non-prod SSL certs are accepted by Android. This is working fine. The problem is, when we want to run Trapeze to reconfigure things to point to prod/qa (anything non-local) we need to remove the network_security_config.xml and custom CA file.

So, in our local development Trapeze configuration we have this to add the required files:

```
manifest:
- file: AndroidManifest.xml
target: manifest/application
attrs:
android:networkSecurityConfig: "@xml/network_security_config"
res:
- path: raw
file: local_dev_ca
source: path/to/local_dev_ca
- path: xml
file: network_security_config.xml
source: path/to/network_security_config.xml
```

In our prod Trapeze config we are able to delete the AndroidManifest.xml changes with:

```
manifest:
- file: AndroidManifest.xml
target: manifest/application
deleteAttributes:
- android:networkSecurityConfig
```

But how do we delete the two files from under `android/app/src/main/res` using Trapeze? It would be nice to have Trapeze handle this, but I suppose it would be easy enough to just run `rm android/app/src/main/res/...` as a separate step.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.