This is an automated email from the ASF dual-hosted git repository. erisu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push: new e4457f7f chore!: update template defaults (#1837) e4457f7f is described below commit e4457f7fdb7eb854d166bb87b144bf4e1873cf61 Author: エリス <er...@users.noreply.github.com> AuthorDate: Tue Aug 19 13:55:18 2025 +0900 chore!: update template defaults (#1837) * chore: update default package id * chore: sync cordova-app-hello-world defaults & modified for Android differences --- framework/cdv-gradle-config-defaults.json | 2 +- lib/create.js | 2 +- spec/unit/create.spec.js | 4 +- templates/cordova/defaults.xml | 35 ++++++------- templates/project/res/xml/config.xml | 71 +++++++++++++-------------- test/androidx/app/src/main/res/xml/config.xml | 2 +- 6 files changed, 57 insertions(+), 59 deletions(-) diff --git a/framework/cdv-gradle-config-defaults.json b/framework/cdv-gradle-config-defaults.json index f90f9a5f..36877074 100644 --- a/framework/cdv-gradle-config-defaults.json +++ b/framework/cdv-gradle-config-defaults.json @@ -12,7 +12,7 @@ "GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2", "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false, "IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false, - "PACKAGE_NAMESPACE": "io.cordova.helloCordova", + "PACKAGE_NAMESPACE": "org.apache.cordova.hellocordova", "JAVA_SOURCE_COMPATIBILITY": 11, "JAVA_TARGET_COMPATIBILITY": 11, "KOTLIN_JVM_TARGET": null diff --git a/lib/create.js b/lib/create.js index 6ac56522..3c4c3d75 100755 --- a/lib/create.js +++ b/lib/create.js @@ -205,7 +205,7 @@ exports.create = function (project_path, config, options, events) { return Promise.reject(new CordovaError('Project already exists! Delete and recreate')); } - const package_name = config.android_packageName() || config.packageName() || 'io.cordova.helloCordova'; + const package_name = config.android_packageName() || config.packageName() || 'org.apache.cordova.hellocordova'; const project_name = config.name() || 'Hello Cordova'; const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity'; diff --git a/spec/unit/create.spec.js b/spec/unit/create.spec.js index 27652971..00bbf8a3 100644 --- a/spec/unit/create.spec.js +++ b/spec/unit/create.spec.js @@ -155,10 +155,10 @@ describe('create', function () { }); describe('parameter values and defaults', function () { - it('should have a default package name of io.cordova.helloCordova', () => { + it('should have a default package name of org.apache.cordova.hellocordova', () => { config_mock.packageName.and.returnValue(undefined); return create.create(project_path, config_mock, {}, events_mock).then(() => { - expect(create.validatePackageName).toHaveBeenCalledWith('io.cordova.helloCordova'); + expect(create.validatePackageName).toHaveBeenCalledWith('org.apache.cordova.hellocordova'); }); }); diff --git a/templates/cordova/defaults.xml b/templates/cordova/defaults.xml index 5286ab9c..2034102b 100644 --- a/templates/cordova/defaults.xml +++ b/templates/cordova/defaults.xml @@ -1,25 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. --> -<widget xmlns = "http://www.w3.org/ns/widgets" - id = "io.cordova.helloCordova" - version = "2.0.0"> +<widget xmlns="http://www.w3.org/ns/widgets" + xmlns:cdv="http://cordova.apache.org/ns/1.0" + id="org.apache.cordova.hellocordova" + version="1.0.0"> <!-- Preferences for Android --> <preference name="loglevel" value="DEBUG" /> diff --git a/templates/project/res/xml/config.xml b/templates/project/res/xml/config.xml index 638709d3..da9a77fd 100644 --- a/templates/project/res/xml/config.xml +++ b/templates/project/res/xml/config.xml @@ -1,56 +1,53 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. --> -<widget xmlns = "http://www.w3.org/ns/widgets" - id = "io.cordova.helloCordova" - version = "2.0.0"> +<widget xmlns="http://www.w3.org/ns/widgets" + xmlns:cdv="http://cordova.apache.org/ns/1.0" + id="org.apache.cordova.hellocordova" + version="1.0.0"> <name>Hello Cordova</name> - <description> A sample Apache Cordova application that responds to the deviceready event. </description> - - <author href="http://cordova.io" email="d...@cordova.apache.org"> + <author email="d...@cordova.apache.org" href="https://cordova.apache.org"> Apache Cordova Team </author> - <!-- <content src="http://mysite.com/myapp.html" /> for external pages --> + <!-- https://s.apache.org/cdv-content-config --> <content src="index.html" /> - <!-- Allow List docs: https://cordova.apache.org/docs/en/latest/ --> - <access origin="*" /> - <!-- Grant certain URLs the ability to launch external applications. This - behaviour is set to match that of Cordova versions before 3.6.0, and - should be reviewed before launching an application in production. It - may be changed in the future. --> + <!-- To allow connections to other resources, you must explicitly permit them using `access` tags. --> + <!-- https://s.apache.org/cdv-network-request-access --> + <!-- Example: + <access origin="https://cordova.apache.org" /> + --> + + <!-- To control which URLs the WebView itself can be navigated to, use the `allow-navigation` tags. --> + <!-- https://s.apache.org/cdv-allow-navigation --> + <!-- Example: + <allow-navigation href="https://cordova.apache.org/*" /> + --> + + <!-- To control which URLs the app is allowed to ask the system to open, use the `allow-intent` tags. --> + <!-- https://s.apache.org/cdv-allow-intent --> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> - <allow-intent href="tel:*" /> - <allow-intent href="sms:*" /> - <allow-intent href="mailto:*" /> - <allow-intent href="geo:*" /> - <allow-intent href="market:*" /> <preference name="loglevel" value="DEBUG" /> - <!-- - <preference name="loadUrlTimeoutValue" value="20000" /> - <preference name="InAppBrowserStorageEnabled" value="true" /> - <preference name="disallowOverscroll" value="true" /> - --> </widget> diff --git a/test/androidx/app/src/main/res/xml/config.xml b/test/androidx/app/src/main/res/xml/config.xml index a824011e..15e8d0f3 100644 --- a/test/androidx/app/src/main/res/xml/config.xml +++ b/test/androidx/app/src/main/res/xml/config.xml @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. --> -<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets"> +<widget id="org.apache.cordova.hellocordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets"> <name>Hello Cordova</name> <description> A sample Apache Cordova application that responds to the deviceready event. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org