chore!: update template defaults (#1837)

* chore: update default package id
* chore: sync cordova-app-hello-world defaults & modified for Android differences
This commit is contained in:
エリス
2025-08-19 13:55:18 +09:00
committed by GitHub
parent 8742cfe4a6
commit e4457f7fdb
6 changed files with 57 additions and 59 deletions

View File

@@ -12,7 +12,7 @@
"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2", "GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.4.2",
"IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false, "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false,
"IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false, "IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false,
"PACKAGE_NAMESPACE": "io.cordova.helloCordova", "PACKAGE_NAMESPACE": "org.apache.cordova.hellocordova",
"JAVA_SOURCE_COMPATIBILITY": 11, "JAVA_SOURCE_COMPATIBILITY": 11,
"JAVA_TARGET_COMPATIBILITY": 11, "JAVA_TARGET_COMPATIBILITY": 11,
"KOTLIN_JVM_TARGET": null "KOTLIN_JVM_TARGET": null

View File

@@ -205,7 +205,7 @@ exports.create = function (project_path, config, options, events) {
return Promise.reject(new CordovaError('Project already exists! Delete and recreate')); 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 project_name = config.name() || 'Hello Cordova';
const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity'; const safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity';

View File

@@ -155,10 +155,10 @@ describe('create', function () {
}); });
describe('parameter values and defaults', 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); config_mock.packageName.and.returnValue(undefined);
return create.create(project_path, config_mock, {}, events_mock).then(() => { 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');
}); });
}); });

View File

@@ -1,25 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
distributed with this work for additional information distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at 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, Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<widget xmlns = "http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova" xmlns:cdv="http://cordova.apache.org/ns/1.0"
version = "2.0.0"> id="org.apache.cordova.hellocordova"
version="1.0.0">
<!-- Preferences for Android --> <!-- Preferences for Android -->
<preference name="loglevel" value="DEBUG" /> <preference name="loglevel" value="DEBUG" />

View File

@@ -1,56 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
distributed with this work for additional information distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at 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, Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<widget xmlns = "http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova" xmlns:cdv="http://cordova.apache.org/ns/1.0"
version = "2.0.0"> id="org.apache.cordova.hellocordova"
version="1.0.0">
<name>Hello Cordova</name> <name>Hello Cordova</name>
<description> <description>
A sample Apache Cordova application that responds to the deviceready event. A sample Apache Cordova application that responds to the deviceready event.
</description> </description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
<author href="http://cordova.io" email="dev@cordova.apache.org">
Apache Cordova Team Apache Cordova Team
</author> </author>
<!-- <content src="http://mysite.com/myapp.html" /> for external pages --> <!-- https://s.apache.org/cdv-content-config -->
<content src="index.html" /> <content src="index.html" />
<!-- Allow List docs: https://cordova.apache.org/docs/en/latest/ --> <!-- To allow connections to other resources, you must explicitly permit them using `access` tags. -->
<access origin="*" /> <!-- https://s.apache.org/cdv-network-request-access -->
<!-- Grant certain URLs the ability to launch external applications. This <!-- Example:
behaviour is set to match that of Cordova versions before 3.6.0, and <access origin="https://cordova.apache.org" />
should be reviewed before launching an application in production. It -->
may be changed in the future. -->
<!-- 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="http://*/*" />
<allow-intent href="https://*/*" /> <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="loglevel" value="DEBUG" />
<!--
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
</widget> </widget>

View File

@@ -17,7 +17,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. 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> <name>Hello Cordova</name>
<description> <description>
A sample Apache Cordova application that responds to the deviceready event. A sample Apache Cordova application that responds to the deviceready event.