cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenichi Naito (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-13496) the plugin config-file tag for iOS plist array behaves unnaturally.
Date Wed, 01 Nov 2017 04:53:00 GMT

    [ https://issues.apache.org/jira/browse/CB-13496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16233657#comment-16233657
] 

Kenichi Naito edited comment on CB-13496 at 11/1/17 4:52 AM:
-------------------------------------------------------------

Thanks, Audrey.

For example if you add the plugin where plugin.xml has
```
    <platform name="ios">
      <config-file target="*-Debug.plist" parent="keychain-access-groups">
        <array>
          <string>$(AppIdentifierPrefix)$PACKAGE_NAME</string>
          <string>$(AppIdentifierPrefix)com.example.mylib</string>
        </array>
      </config-file>
```
the Entitlements-Debug.plist becomes
```
  <dict>
    <key>keychain-access-groups</key>
    <array>
      <string>$(AppIdentifierPrefix)io.cordova.hellocordova</string>
      <string>$(AppIdentifierPrefix)com.example.mylib</string>
    </array>
  </dict>
```
However after cordova prepare command, the Entitlements-Debug.plist  becomes
```
  <dict>
    <key>keychain-access-groups</key>
    <array>
      <string>$(AppIdentifierPrefix)io.cordova.hellocordova</string>
    </array>
  </dict>
```
because nodeEqual function treats the above two string as `(.*?)`. Therefore
one of two is removed.


was (Author: knaito):
Thanks, Audrey.

For example if you add the plugin where plugin.xml has
```
    <platform name="ios">
      <config-file target="*-Debug.plist" parent="keychain-access-groups">
        <array>
          <string>$(AppIdentifierPrefix)$PACKAGE_NAME</string>
          <string>$(AppIdentifierPrefix)com.example.mylib</string>
        </array>
      </config-file>
```
the Entitlements-Debug.plist becomes
```
  <dict>
    <key>keychain-access-groups</key>
    <array>
      <string>$(AppIdentifierPrefix)io.cordova.hellocordova</string>
      <string>$(AppIdentifierPrefix)com.example.mylib</string>
    </array>
  </dict>
```
However after cordova prepare command, the Entitlements-Debug.plist  becomes
```
  <dict>
    <key>keychain-access-groups</key>
    <array>
      <string>$(AppIdentifierPrefix)io.cordova.hellocordova</string>
    </array>
  </dict>
```
because nodeEqual function treat the above two string as `(.*?)`. Therefore
one of two is removed.

> the plugin config-file tag for iOS plist array behaves unnaturally.
> -------------------------------------------------------------------
>
>                 Key: CB-13496
>                 URL: https://issues.apache.org/jira/browse/CB-13496
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-common
>    Affects Versions: 2.1.0
>         Environment: Mac OSX
>            Reporter: Kenichi Naito
>   Original Estimate: 504h
>  Remaining Estimate: 504h
>
> In the src/util/plist-helpers.js, in the nodeEqual function,
> ```
> node2 = escapeRE(node2).replace(/\\\$\S+/gm, '(.*?)');
> ```
> seems the strange behavior.
> For example, the escaped node2 "$(ABC)Hello" becomes "(.*?)".
> In the previous version of this code is
> ```
> node2 = escapeRE(node2).replace(new RegExp('\\$[a-zA-Z0-9-_]+','gm'),'(.*?)');
> ```
> in this case, the escaped node2 "$(ABC)Hello" is unchaned.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message