mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
[Major] Removed unnecessary project name restriction (#859)
* removed unnecessary restriction that prevented project names from starting with a number. Project names starting with a number is perfectly valid. * Reworded validateProjectName jsdoc Co-Authored-By: Raphael von der Grün <raphinesse@gmail.com> Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
This commit is contained in:
+1
-11
@@ -208,7 +208,7 @@ function validatePackageName (package_name) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a project name is acceptable for use as an android class.
|
||||
* Test whether given string is acceptable for use as a project name
|
||||
* Returns a promise, fulfilled if the project name is acceptable; rejected
|
||||
* otherwise.
|
||||
*/
|
||||
@@ -219,16 +219,6 @@ function validateProjectName (project_name) {
|
||||
return Promise.reject(new CordovaError(msg + 'Project name cannot be empty'));
|
||||
}
|
||||
|
||||
// Enforce stupid name error
|
||||
if (project_name === 'CordovaActivity') {
|
||||
return Promise.reject(new CordovaError(msg + 'Project name cannot be CordovaActivity'));
|
||||
}
|
||||
|
||||
// Classes in Java don't begin with numbers
|
||||
if (/^[0-9]/.test(project_name)) {
|
||||
return Promise.reject(new CordovaError(msg + 'Project name must not begin with a number'));
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user