Coder Social home page Coder Social logo

ionic-team / trapeze Goto Github PK

View Code? Open in Web Editor NEW
300.0 12.0 39.0 22.78 MB

The mobile project configuration toolbox. Manage native iOS, Android, Ionic/Capacitor, React Native, and Flutter apps through a simple YAML format.

Home Page: https://trapeze.dev

License: Other

JavaScript 8.20% TypeScript 86.71% Java 1.82% Shell 0.25% SCSS 3.02%
capacitor ios android xcode

trapeze's Introduction

Trapeze Logo

🤸‍♀️ Easy automated project configuration for iOS, Android, Capacitor, React Native, Flutter, and more 🤸‍♀️


Trapeze is a mobile project configuration toolbox for native iOS and Android project management. From a simple YAML format, Trapeze makes it easy to automate the configuration of native mobile iOS and Android projects, and supports traditional native, Ionic, Capacitor, React Native, Flutter, and .NET MAUI. The long-term goal of Trapeze is to enable fully immutable native mobile projects.

Trapeze works by automating the modification of pbxproj, plist, XML, Gradle, JSON, resource, properties, and other files in iOS and Android app projects. It features a configuration-driven tool that takes a YAML file with iOS and Android project modifications and performs those modifications from the command line interactively.

For example, modifying your project is as easy as writing a configuration file:

platforms:
  ios:
    targets:
      App:
        bundleId: $BUNDLE_ID
        version: $VERSION

  android:
    packageName: com.example.app
    versionName: $VERSION_NAME
    versionCode: $VERSION_CODE

Each one of these variables can be supplied from the environment or interactively when running the command. There are many more configuration options available.

A Project API is also available for writing custom JavaScript/TypeScript project modification scripts for full control. The configuration tool uses this API under the hood.

See trapeze.dev for full documentation and to get started using Trapeze.

Note: this project was formerly known as capacitor-configure but has now been expanded to support other mobile frameworks and renamed to Trapeze as of June 2022

trapeze's People

Contributors

chernodub avatar crylion avatar dotnetkow avatar jaredcbaum avatar kensodemann avatar kentora avatar ksteuer avatar leo-jnesis avatar mlynch avatar ngandon avatar saimon24 avatar stefanhuber avatar stewones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trapeze's Issues

It is not possible to set UISupportedInterfaceOrientations

I am trying to set the UISupportedInterfaceOrientations (and UISupportedInterfaceOrientations~ipad), but setting

          - UISupportedInterfaceOrientations:
              - UIInterfaceOrientationPortrait
          - UISupportedInterfaceOrientations~ipad:
              - UIInterfaceOrientationPortrait

in yaml file has no effects, as long as info.plist has a UISupportedInterfaceOrientations entry already. I suspect the reason is that the entries are merged into the existing, when in reality (At least for these two cases) they should override.

Maybe there should be a way to specify that the array should be overridden in the yaml file, to avoid having to maintain a list over entries that should be overridden as opposed to merged.

Update gradle wrapper properties

Hello everyone.

Is there a way to change the gradle wrapper properties, found in the gradle/wrapper/gradle-wrapper.properties file, using the capacitor configure?

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

I recently updated the gradle version in the build.gradle file and it is asking me to update the distributionUrl

from

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip

to

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

Thank you in advance.

Track app project root in config

Right now the config only has ios and android path info, it should also track the project root so users don't have to track that themselves

Quote strings before updating pbx

Some pbx parsers are sensitive about strings being quoted (like the one used by cocoapods) and we're currently not quoting strings when writing back

configure: does neither create, nor change the App.entitlements file

Current behavior

  1. If the App.entitlements file does not exist, it's not created.
  2. If the App.entitlements was created through Xcode (by adding a capability) before running cap-configure, the file stays untouched.
  3. In the preview, the CLI does not mention any changes to the file.

Expected behavior

I expected it to create the file under ios/App/App/App.entitlements.

Version

I observed this behavior in version 1.0.20

Reproduction

I've created a demo repo for you to quickly reproduce.

https://github.com/tobiasmuecksch/cap-configure-problem-demo

  1. clone repo
  2. run npm run init
    • Info: This task installs npm packages, adds the ios and android platforms and runs cap-configure
  3. check the ios/App/App/ folder, and you'll see, that the App.entitlements is missing.

setAttrs doesn't work and not update AndroidManifest

When use setAttrs for modify the AndroidManifest values the final result remove all data in my AndroidManifest
project.android?.getAndroidManifest() .setAttrs( "/manifest/application/meta-data[@*='com.google.android.geo.API_KEY']",
{
'android:value': '---API-KEY---',
}
);

image

I was reviewing the code and it seems that the problem is in the following toString () method. It is empty and does nothing

https://github.com/ionic-team/capacitor-configure/blob/d6d939ae2092b416905e3ae7f4e5d6db4973ce73/packages/project/src/android/manifest.ts#L24

How to use the capacitor project

Hello to everyone and thank you for this tool.

I read the blog post Automated Capacitor Project Configuration with Capacitor Configure, I also read the documentation on this repository and I didn't understand how and when should I run the project configuration.

Should I use the capacitor.config.ts or should I create a new file?
How should I run it?
Will it run every time I use the capacitor cli (example adding platform)?
Should I run the new .ts file using node?
When I do that it is showing the below error:

SyntaxError: Cannot use import statement outside a module

I am really looking forward using this tool.
Any help would be appreciated

Replacing ios app entitlements with YAML

Hi Max!

I thought it would be nice if we can replace the ios entitlements that have multiple values. The way I'm doing this now is combined with the Typescript approach:
capacitor.ts

  const project: CapacitorProject = new CapacitorProject(config)
  await project.load()

  const appTarget = project.ios?.getAppTarget()
  const targetName = appTarget.name
  const buildName: IosBuildName = `Release` // Release, Debug or null

  // clean entitlements
  const entitlements = await project.ios?.getEntitlements(targetName, buildName)
  delete entitlements[`com.apple.developer.associated-domains`]

  // commit changes
  await project.commit()

capacitor.yaml

entitlements:
          - com.apple.developer.associated-domains:
              [
                'applinks:$BASE_URL',
                'applinks:$NEWSAPP_PAGE_LINK',
              ]

and execute them in this order:

npx tsc configuration/capacitor.ts && node configuration/capacitor.js
npx @capacitor/[email protected] run configuration/capacitor.yaml -y

Maybe the inject / replace approach from the gradle file would work here as well.

I don't think I'd be able to contribute to the repo at this stage but I'll be happy to test any functionality that you decide to have a crack at. Best regards

how to use dynamic variables for simulator or xcode

vars:
 CI_BUILD_NUMBER:
  BUNDLE_ID:
  REVERSED_CLIENT_ID:
  DOMAIN:
  APP_NAME:

platforms:
  ios:
    targets:
      App:
        bundleId: '"$(BUNDLE_ID)"'
        buildNumber: '"$(CI_BUILD_NUMBER)"'
        productName: '"$(TARGET_NAME)"'
        displayName: "$(APP_NAME)"

for example in appflow is working

but is open this in xcode for simulator, have clean fileds

BUNDLE_ID=com.app.app npx cap open ios

Screenshot 2022-01-04 at 14 14 02

Support other plist files

It would be great to use this to update the GoogleService-Info.plist file commonly used for Firebase projects.

configure: `applicationId` in `build.gradle` stays unchanged

Current behavior

When running cap-configure it seems to ignore the applicationId for android

plaftorm-config.yml

vars:
  PACKAGE_NAME_ANDROID:
    default: com.capconfigure.demoandroid

  android:
    packageName: $PACKAGE_NAME_ANDROID
    versionName: 2.2.2
    versionCode: 222

Bildschirmfoto 2021-11-30 um 07 23 02

Version

I observed this behavior in version 1.0.20

Reproduction

I've created a demo repo for you to quickly reproduce.

https://github.com/tobiasmuecksch/cap-configure-problem-demo

  1. clone repo
  2. run npm run init
    • Info: This task installs npm packages, adds the ios and android platforms and runs cap-configure

Then check the android/app/build.gradle-file, and you'll see, that the applicationId is not updated correctly.

configure: Share operations between targets/builds

These plugins look promising. Thanks for the good work so far.

Regarding the configure plugin: Is it correct that ATM no operations can be shared across multiple targets or builds?

An example:

vars:
  BUNDLE_ID:
    default: com.example.app
  APP_NAME:
    default: App

platforms:
  ios:
    targets:
      version: 0.0.1
      App:
        bundleId: $BUNDLE_ID
        builds:
          Debug:
            displayName: $APP_NAME Dev
          Release:
            displayName: $APP_NAME
      App Clip:
        bundleId: $(BUNDLE_ID).appclip
        builds:
          Debug:
            displayName: $APP_NAME Clip Dev
          Release:
            displayName: $APP_NAME Clip

My desired outcome would be: The version number is used across all targets (App / App Clip) and builds (Debug / Release). bundleId: $BUNDLE_ID is shared across all builds of App and bundleId: $(BUNDLE_ID).appclip is shared across all builds of App Clip. The display name is individual for each target and build combination.

If I see it correctly, ATM I would have to repeat myself and use a configuration like this:

vars:
  BUNDLE_ID:
    default: com.example.app
  APP_NAME:
    default: App

platforms:
  ios:
    targets:
      App:
        builds:
          Debug:
            version: 0.0.1
            bundleId: $BUNDLE_ID
            displayName: $APP_NAME Dev
          Release:
            version: 0.0.1
            bundleId: $BUNDLE_ID
            displayName: $APP_NAME
      App Clip:
        builds:
          Debug:
            version: 0.0.1
            bundleId: $(BUNDLE_ID).appclip
            displayName: $APP_NAME Clip Dev
          Release:
            version: 0.0.1
            bundleId: $(BUNDLE_ID).appclip
            displayName: $APP_NAME Clip

Feedback on use cases

I'm looking to map all the different use cases Capacitor developers have when looking to a tool like this. I want to make sure this tool can cater to those needs. My goal is you should never need to write or ship a custom script to configure your app, as that adds big maintenance and developer experience overhead.

Please share your use cases in this issue, thanks!

cap-config should get projectRootPath as argument

Hi ! Thank for this project that I have discovered lately (after struggling with cordova-node-xcode ...)
I'd like to use @capacitor/configure but my workspaces are not in the default 'ios'/'android' path.

Could you provide a parameter to set the project root path ?

Running yml file without confirmation does not configure Android project

Hello,

I am using the below yml file

vars:
  VERSION:
    default: 1.0.1

platforms:
  ios:
    targets:
      App:
        version: $VERSION

  android:
    versionName: $VERSION

If I run

npx cap-config run config.yml

it is working fine

But if I want to run the yml file without confirmation using the -y

npx cap-config run config.yml -y

The Android version name it is not being updated.

Am I doing something wrong, should I do something different or is something there that it is not waiting for the change to finish.

Thank you in advance.

Bug: Update breaks yaml tool

Hi Max

We've been using this great tool for a while for white labeling but since the most recent update the yaml configuration is broken. I suppose it might have to do with the capacitor.config.ts being taken into consideration, so I posted it down below for reference. For the meantime I solved it by using the previous version like this (@1.0.31)

npm_config_yes=true npx dotenv-cli -- npx @capacitor/[email protected] run configuration/capacitor.yaml -y

For example my ios entitlements are not being updated:

entitlements:
          - com.apple.developer.associated-domains:
              [
                'applinks:$BASE_URL'
              ]

capacitor.config.ts:

import { CapacitorConfig } from "@capacitor/cli"

const config: CapacitorConfig = {
  appId: `ch.example.app`,
  appName: `exampleApp`,
  webDir: `dist/app`,
  bundledWebRuntime: false,
  ios: {
    contentInset: `never`,
  },
  plugins: {
    SplashScreen: {
      launchAutoHide: false,
      androidScaleType: `CENTER_CROP`,
    },
  },
  server: {
    // hostname: 'ch.example.app', // this property will fix the ad displaying of audienzz on android
  },
  loggingBehavior: `production`, // 'none' | 'debug' | 'production'
}

export default config

Info.plist: indentation and new line

The indentation of Info.plist files is changed from tabs (Xcode default) to spaces and an empty line is added at the end of the file. This will be reverted when the Info.plist is edited in Xcode again. The same applies to entitlements files.

Screenshot 2021-12-02 at 15 05 55

configure: Info.plist stays unchanged

Current behavior

When running cap-configure it seems to ignore my infoPlist-settings

    infoPlist:
      - CFBundleDevelopmentRegion: de_DE
      - NSCameraUsageDescription: Hochladen von Bildern für Chat und Profil.
      - NSPhotoLibraryAddUsageDescription: Speichern von Bildern aus dem Chat-Verlauf.
      - NSPhotoLibraryUsageDescription: Hochladen von Bildern für Chat und Profil.
      - ITSAppUsesNonExemptEncryption: false

Expected behavior

I expected it to add the properties above to the Info.plist-file

Version

I observed this behavior in version 1.0.20

Reproduction

I've created a demo repo for you to quickly reproduce.

https://github.com/tobiasmuecksch/cap-configure-problem-demo

  1. clone repo
  2. run npm run init
    • Info: This task installs npm packages, adds the ios and android platforms and runs cap-configure

Then check the ios/App/App/Info.plist-file, and you'll see, that none of the settings above are set.

Adding permissions using yml file

Hello everyone,

I am trying to add some permissions on the AndroidManifest.xml file using a yml file.

I am adding the below lines on my yml file

  android:
    manifest:
      - file: AndroidManifest.xml
        target: manifest/application
        inject: |
          <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
          <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
          <uses-feature android:name="android.hardware.location.gps" />

and when I run the yml file it only enters the first one.

Am I doing something wrong?
Does the inject accept only one xml tag?
Is there another way to add permissions?

Thank you in advance

npx cap-config stuck when gradle is references in config

Hello, I am running on Mac with OpenJdk:
openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

When I run cap-config it is stuck, and I cannot see where is the problem. I see the java process of capacitor-gradle-parse.jar but nothing happens...

The gradle file is a standard file generated from capacitor 6... I am attaching the file

configure: entitlements not generated, infoPlist not updating

When I use entitlements like shown in the example basic.yml, no changes are made to my .entitlements file.

        entitlements:
          - keychain-access-groups:
              [
                "$BUNDLE_ID",
                "com.microsoft.intune.mam",
                "com.microsoft.adalcache",
              ]

Also: The structure of the Info.plist that Xcode generated is:

// ...
<plist version="1.0">
<dict>
	<key>NSAppClip</key>
	<dict>
		<key>NSAppClipRequestEphemeralUserNotification</key>
		<false/>
		<key>NSAppClipRequestLocationConfirmation</key>
		<false/>
	</dict>
// ...
</dict>
</plist>

So I assumed that infoPlist should also contain a dictionary (NSAppClip without the -) and not a list in the yaml file, like:

        infoPlist:
          NSAppClip:
            NSAppClipRequestEphemeralUserNotification: false
            NSAppClipRequestLocationConfirmation: false

But this leads to the error:


[error] entries is not iterable
Unhandled Rejection TypeError: entries is not iterable
    at execute (/node_modules/@capacitor/configure/dist/operations/ios/plist.js:6:25)
    at runOperation (/node_modules/@capacitor/configure/dist/operations/index.js:45:16)
    at executeOperations (/node_modules/@capacitor/configure/dist/tasks/run.js:60:40)
    at async runCommand (/node_modules/@capacitor/configure/dist/tasks/run.js:28:9)
    at async /node_modules/@capacitor/configure/dist/index.js:51:9
    at async Command.<anonymous> (/node_modules/@capacitor/configure/dist/util/cli.js:31:13)
/node_modules/@capacitor/configure/bin/cap-config:13
  throw err;
  ^

When I use infoPlist like the following, it writes the desired result to the Info.plist file, but only if the keys do not already exist (If I delete them from the file manually beforehand). Is this on purpose?

        infoPlist:
          - NSAppClip:
              NSAppClipRequestEphemeralUserNotification: true
              NSAppClipRequestLocationConfirmation: false

Using YAML to modify build.gradle

If this is already supported I haven't been able to find how to modify values in app/build.gradle.

  android:
    packageName: $APP_IDENTIFIER
    versionName: $APP_VERSION
    versionCode: $BUILD_NUMBER_ANDROID

    gradle:
      - file: app/build.gradle
        target:
          android:
            defaultConfig:
        insert: |
          manifestPlaceholders = [baseUrl:"$BASE_URL"]

I'm trying to use the ENV variable that I imported in the YAML to set a baseUrl variable that I can use in the AndroidManifest.xml (since I didn't find how to replace values there, only inject new ones). But instead of adding/replacing, it always adds a new entry. So whenever I switch my deploy target for the app, I end up with multiple variables as the old ones dont get replaced.

Is this possible with either YAML or TS or do I have to use shell or node script for now?

Running configure multiple times with CFBundleUrlScheme does not merge dicts correctly

With yaml file containing

       infoPlist:
          - CFBundleUrlTypes:
              - CFBundleUrlSchemes:
                  - MyApp

running the configure command multiple times yields the following content in info.plist:

    <key>CFBundleUrlTypes</key>
    <array>
      <dict>
        <key>CFBundleUrlSchemes</key>
        <array>
          <string>MyApp</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleUrlSchemes</key>
        <array>
          <string>MyApp</string>
        </array>
      </dict>
    </array>

Expected behaviour is to merge correctly, instead of adding an entry on each run.

configure: iOS bundleId is not reflected in Xcode

Current behavior

When running cap-configure it seems to ignore my bundleId-setting for iOS.

vars:
  BUNDLE_ID_IOS:
    default: com.cap-configure.demo-ios

platforms:
  ios:
    targets:
      App:
        bundleId: $BUNDLE_ID_IOS

Screenshot

Bildschirmfoto 2021-11-30 um 17 55 57

Version

I observed this behavior in version 1.0.21

Reproduction

I've created a demo repo for you to quickly reproduce.

https://github.com/tobiasmuecksch/cap-configure-problem-demo

  1. clone repo
  2. run npm run init
    • Info: This task installs npm packages, adds the ios and android platforms and runs cap-configure

Then open Xcode ionic cap open ios and see, that the bundle identifier is not the same as in the yml file.

Changes to files should have unix file separators instead of system default

We are using this to configure on windows, before sending it to a Mac to build. Right now I run into a problem when setting entitlements, where the 'CODE_SIGN_ENTITLEMENTS' in pbxproj is being set to App\App.entitlements instead of App/App.entitlements
(This line)
https://github.com/ionic-team/capacitor-configure/blob/c4df76cdf629a9b5f9f3c0964291c924c27d099d/packages/project/src/ios/project.ts#L290

This - and other places if such exists - where paths are being set, unix style seperators should be used.

getBuild and getVersion of iOS returning undefined

In the following sample repo the methods for getBuild and getVersion are returning undefined (using an Ionic starter):
https://github.com/dtarnawsky/cap-config-issue

This is the code that calls project.ios.getBuild:
https://github.com/dtarnawsky/cap-config-issue/blob/main/test/test.ts

These methods should be returning a valid build and version as shown in the xcode project.

Code pasted below for convenience (use npm run config to run this):

import { CapacitorProject } from '@capacitor/project';
import { CapacitorConfig } from '@capacitor/cli';

const test = async () => {
    const config: CapacitorConfig = {
        ios: {
            path: 'ios',
        },
        android: {
            path: 'android',
        },
    };

    const project = new CapacitorProject(config);
    await project.load();
    for (const target of project.ios.getTargets()) {
        console.log(`iOS target id=${target.id} name=${target.name}`);
        console.log('=========================');
        console.log('iOS Bundle id', project.ios.getBundleId(target.name, 'Debug'));
        for (const buildConfig of project.ios?.getBuildConfigurations(target.name)) {
            console.log(`${buildConfig.name} getBuild`,project.ios.getBuild(target.name, buildConfig.name));
            console.log(`${buildConfig.name} getVersion`,project.ios.getVersion(target.name, buildConfig.name));
        }
       }

    console.log('Android version name', await project.android.getVersionName());
    console.log('Android version code', await project.android.getVersionCode());
    console.log('Android package name', project.android.getPackageName());
};

test();

How can I change the version code on Android

Hello,

from this example I don't see an option on how to change the version code on an Android project.

Following the logic of the API I found this file, where I am seeing that the option should be versionCode.
I added on my yml file, but it is not updated the version code.

Is this something it is not supported yet? Am I doing something wrong?

Thank you in advance

API and configuration

Some of the feedback I've gotten so far is developers would like to be able to use this tool both from code and from configuration.

Initially, I've been focused on configuration as the primary way to use this tool (aka through a yaml file), but I can see the benefit of exposing a library for programmatic usage as well.

For example:

import { Project } from '@capacitor/configure';

const platforms = await Project.getPlatforms();
await platforms.ios.setDisplayName('Display Name');
await platforms.ios.incrementBuild();

Would this be useful to you?

Info.plist is overwritten with empty object after latest changes

Expected Behavior

Values set in the project are merged with existing values in Info.plist

Actual Behavior

Values set in the project are merged with an empty object

Steps to Reproduce the Problem

 ...
 const project = new CapacitorProject(config);
 await this.project.load();
 await this.project.ios?.setVersion(APP_TARGET_NAME, APP_BUILD_NAME, CURRENT_VERSION);
 await project.commit();
 ....

Specifications

  • Version: 1.0.21
  • Platform: iOS

Actual problem

I found that there is an issue with parsing Plist file:

export async function parsePlist(filename: string) {
  const contents = await readFile(filename, { encoding: 'utf-8' });

  const parsed = plist.parse(contents);

  // If the plist is empty an empty array will come back
  // which is not what we want
  if (!(parsed as any[]).length) { //  <======= HERE
    return {};
  }

  return parsed;
}

We should not check parsed.length property as it usually is an object and as a result we always return empty object which later is merged with our new properties. Maybe lodash.isEmpty method would be relevant?

configure: multiple issues with newly created platforms

Current behavior

It seems, that configure does only manipulate the App.entitlements file if it already exists. If it does not exist, it does nothing. In the preview, the CLI does not mention any changes to the file.

And some more issues, as described in the comment below

Expected behavior

I expected it to create the file under ios/App/App/App.entitlements.

Reproduction

I've created a demo repo for you to quickly reproduce.

https://github.com/tobiasmuecksch/cap-configure-problem-demo

  1. clone repo
  2. run npm run init
    • Info: This task installs npm packages, adds the ios and android platforms and runs cap-configure
  3. check the ios/App/App/ folder, and you'll see, that the App.entitlements is missing.

Update minSdkVersion and targetSdkVersion in the variables.gradle file

Hello everyone.

I want to change the minSdkVersion and the targetSdkVersion in the variables.gradle file.

I couldn't find a way to do this neither on the capacitor.config.ts file nor using the capacitor-configure tool.

Am I missing something or is this not implemented yet?

Thank you in advance.

configure: Request for `-y` flag

In order to be able to use cap-configure in a CI pipeline, I'd like to request a -y flag, which suppresses all questions and automatically answers them with yes. Especially the Apply changes? question 😄

bug: iOS buildNumber only allows number

Up until now, I always used the same version identifier for MARKETING_VERSION and CURRENT_PROJECT_VERSION.

Therefore I expected that setting for example 2.2.2 as buildNumber, would set this value for CURRENT_PROJECT_VERSION in the project.pbxproj file.

Instead it sets 1 as value. I assume, that the input is casted to the number type, which seems to resolve to 1 by default, if the input does not match the expected type.

This is an excerpt of my config.yml

platforms:
  ios:
    targets:
      App:
        bundleId: com.my-cool-app
        version: 2.2.2
        buildNumber: 2.2.2
        incrementBuild: true

This is the current result in the project.pbxproj file:

CURRENT_PROJECT_VERSION = 1;

This is what I expected instead:

CURRENT_PROJECT_VERSION = 2.2.2;

Maybe I'm breaking some convention which I'm not aware of (but Xcode accepts that value without any warning). In that case I'd suggest to show a warning, in order to prevent future obsolete issue tickets.

inject intent-filter does nothing

Hi, I'm trying to automatically add a new intent filter, specifically the one for this plugin: https://capacitorjs.com/docs/apis/app#android but it doesn't seem to work

platforms:
  android:
    manifest:
      - file: AndroidManifest.xml
        target: manifest/application/activity
        inject: |
          <intent-filter>
              <action android:name="android.intent.action.VIEW" />
              <category android:name="android.intent.category.DEFAULT" />
              <category android:name="android.intent.category.BROWSABLE" />
              <data android:scheme="@string/custom_url_scheme" />
          </intent-filter>

tested with version 2.0.0 and 2.0.3

Support variables with dot in YAML substitution

In CI/CD context we are using dot seperated env variables in order to group relevant settings. It would be nice to be able to use these to override vars in YAML files.

Example var name: tcappOne.ios.bundle.id:
Example usage: bundleId: $tcappOne.ios.bundle.id

entitlements are applied to wrong target

Using the following configuration, the entitlements are applied to the App target, not the App Clip target

vars:
  BUNDLE_ID:
    default: com.example.app

platforms:
  ios:
    targets:
      App:
        bundleId: $BUNDLE_ID

      AppClip:
        bundleId: $BUNDLE_ID.Clip

        entitlements:
          - aps-environment: development
          - parent-application-identifiers: [$(AppIdentifierPrefix)$BUNDLE_ID]

CLI Feature-Request: Set variables on command line

It would be nice, to be able to define variables using the command line interface.

For example like this:
npx cap-config run config.yml -var BUNDLE_NAME=io.ionic.example-app -var APP_NAME='My App Name'

Alternatively it would be sufficient if the CLI would respect environment variables, by preferring the cli input over the variables in the yml.

VFS enhancements

Some of the calls create files that are missing (such as entitlements on iOS). These should be created in the VFS so they can be committed optionally using the apply process

Android SigningConfig must be placed before buildTypes element

The android plugin requires (it is a bug in my opinion) that the signingConfigs element is placed BEFORE the buildTypes element.
When I use capacitor/config to create the signingConfigs element it is created after buildTypes (guess it is done in alphabetical order)...
This makes it hard to create a valid build configuration.
Thanks! it is a great tool!!

Support Kotlin-based Gradle files

Currently, the gradle operation and Gradle API features only support Groovy. This is because the Groovy language ships with a parser API that can be used to accurately modify the actual Gradle source file. As far as I know, no such API exists for Kotlin.

Creating an issue to track this and in case anyone knows of a similar Kotlin API

cap-config - Not found

In the README and in the announcement on the bloc a package called cap-configure is mentioned. It tells me to run npx cap-config run config.yaml but it gives me the output:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/cap-config - Not found
npm ERR! 404 
npm ERR! 404  'cap-config@latest' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

If I run npx @capacitor/configure run config.yaml it looks better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.