Skip to content

Commit e4457f7

Browse files
authored
chore!: update template defaults (#1837)
* chore: update default package id * chore: sync cordova-app-hello-world defaults & modified for Android differences
1 parent 8742cfe commit e4457f7

File tree

6 files changed

+57
-59
lines changed

6 files changed

+57
-59
lines changed

framework/cdv-gradle-config-defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2",
1313
"IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false,
1414
"IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false,
15-
"PACKAGE_NAMESPACE": "io.cordova.helloCordova",
15+
"PACKAGE_NAMESPACE": "org.apache.cordova.hellocordova",
1616
"JAVA_SOURCE_COMPATIBILITY": 11,
1717
"JAVA_TARGET_COMPATIBILITY": 11,
1818
"KOTLIN_JVM_TARGET": null

lib/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ exports.create = function (project_path, config, options, events) {
205205
return Promise.reject(new CordovaError('Project already exists! Delete and recreate'));
206206
}
207207

208-
const package_name = config.android_packageName() || config.packageName() || 'io.cordova.helloCordova';
208+
const package_name = config.android_packageName() || config.packageName() || 'org.apache.cordova.hellocordova';
209209
const project_name = config.name() || 'Hello Cordova';
210210

211211
const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity';

spec/unit/create.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ describe('create', function () {
155155
});
156156

157157
describe('parameter values and defaults', function () {
158-
it('should have a default package name of io.cordova.helloCordova', () => {
158+
it('should have a default package name of org.apache.cordova.hellocordova', () => {
159159
config_mock.packageName.and.returnValue(undefined);
160160
return create.create(project_path, config_mock, {}, events_mock).then(() => {
161-
expect(create.validatePackageName).toHaveBeenCalledWith('io.cordova.helloCordova');
161+
expect(create.validatePackageName).toHaveBeenCalledWith('org.apache.cordova.hellocordova');
162162
});
163163
});
164164

templates/cordova/defaults.xml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
1919
-->
20-
<widget xmlns = "http://www.w3.org/ns/widgets"
21-
id = "io.cordova.helloCordova"
22-
version = "2.0.0">
20+
<widget xmlns="http://www.w3.org/ns/widgets"
21+
xmlns:cdv="http://cordova.apache.org/ns/1.0"
22+
id="org.apache.cordova.hellocordova"
23+
version="1.0.0">
2324

2425
<!-- Preferences for Android -->
2526
<preference name="loglevel" value="DEBUG" />

templates/project/res/xml/config.xml

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,53 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
1010
11-
http://www.apache.org/licenses/LICENSE-2.0
11+
http://www.apache.org/licenses/LICENSE-2.0
1212
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
1919
-->
20-
<widget xmlns = "http://www.w3.org/ns/widgets"
21-
id = "io.cordova.helloCordova"
22-
version = "2.0.0">
20+
<widget xmlns="http://www.w3.org/ns/widgets"
21+
xmlns:cdv="http://cordova.apache.org/ns/1.0"
22+
id="org.apache.cordova.hellocordova"
23+
version="1.0.0">
2324
<name>Hello Cordova</name>
24-
2525
<description>
2626
A sample Apache Cordova application that responds to the deviceready event.
2727
</description>
28-
29-
<author href="http://cordova.io" email="dev@cordova.apache.org">
28+
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
3029
Apache Cordova Team
3130
</author>
3231

33-
<!-- <content src="http://mysite.com/myapp.html" /> for external pages -->
32+
<!-- https://s.apache.org/cdv-content-config -->
3433
<content src="index.html" />
3534

36-
<!-- Allow List docs: https://cordova.apache.org/docs/en/latest/ -->
37-
<access origin="*" />
38-
<!-- Grant certain URLs the ability to launch external applications. This
39-
behaviour is set to match that of Cordova versions before 3.6.0, and
40-
should be reviewed before launching an application in production. It
41-
may be changed in the future. -->
35+
<!-- To allow connections to other resources, you must explicitly permit them using `access` tags. -->
36+
<!-- https://s.apache.org/cdv-network-request-access -->
37+
<!-- Example:
38+
<access origin="https://cordova.apache.org" />
39+
-->
40+
41+
<!-- To control which URLs the WebView itself can be navigated to, use the `allow-navigation` tags. -->
42+
<!-- https://s.apache.org/cdv-allow-navigation -->
43+
<!-- Example:
44+
<allow-navigation href="https://cordova.apache.org/*" />
45+
-->
46+
47+
<!-- To control which URLs the app is allowed to ask the system to open, use the `allow-intent` tags. -->
48+
<!-- https://s.apache.org/cdv-allow-intent -->
4249
<allow-intent href="http://*/*" />
4350
<allow-intent href="https://*/*" />
44-
<allow-intent href="tel:*" />
45-
<allow-intent href="sms:*" />
46-
<allow-intent href="mailto:*" />
47-
<allow-intent href="geo:*" />
48-
<allow-intent href="market:*" />
4951

5052
<preference name="loglevel" value="DEBUG" />
51-
<!--
52-
<preference name="loadUrlTimeoutValue" value="20000" />
53-
<preference name="InAppBrowserStorageEnabled" value="true" />
54-
<preference name="disallowOverscroll" value="true" />
55-
-->
5653
</widget>

test/androidx/app/src/main/res/xml/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
specific language governing permissions and limitations
1818
under the License.
1919
-->
20-
<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
20+
<widget id="org.apache.cordova.hellocordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
2121
<name>Hello Cordova</name>
2222
<description>
2323
A sample Apache Cordova application that responds to the deviceready event.

0 commit comments

Comments
 (0)