Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2772f203
Commit
2772f203
authored
Feb 19, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2045 from chinmaygarde/master
Always generate legal UTIs for project identifiers.
parents
670bf871
f6a2477d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+11
-1
setup_xcodeproj.dart
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/commands/create.dart
View file @
2772f203
...
...
@@ -98,6 +98,7 @@ abstract class Template {
void
generateInto
(
Directory
dir
,
String
flutterPackagePath
)
{
String
dirPath
=
path
.
normalize
(
dir
.
absolute
.
path
);
String
projectName
=
_normalizeProjectName
(
path
.
basename
(
dirPath
));
String
projectIdentifier
=
_createProjectIdentifier
(
path
.
basename
(
dirPath
));
printStatus
(
'Creating
${path.basename(projectName)}
...'
);
dir
.
createSync
(
recursive:
true
);
...
...
@@ -108,6 +109,7 @@ abstract class Template {
String
contents
=
files
[
filePath
];
Map
m
=
<
String
,
String
>{
'projectName'
:
projectName
,
'projectIdentifier'
:
projectIdentifier
,
'description'
:
description
,
'flutterPackagePath'
:
relativeFlutterPackagePath
};
...
...
@@ -150,6 +152,14 @@ String _normalizeProjectName(String name) {
return
name
;
}
String
_createProjectIdentifier
(
String
name
)
{
// Create a UTI (https://en.wikipedia.org/wiki/Uniform_Type_Identifier) from a base name
RegExp
disallowed
=
new
RegExp
(
r"[^a-zA-Z0-9\-.\u0080-\uffff]+"
);
name
=
name
.
replaceAll
(
disallowed
,
''
);
name
=
name
.
length
==
0
?
'untitled'
:
name
;
return
'com.yourcompany.
${name}
'
;
}
const
String
_analysis_options
=
r''
'
analyzer:
exclude:
...
...
@@ -244,7 +254,7 @@ class FlutterDemoState extends State {
final
String
_apkManifest
=
'''
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="
com.example.{{projectName
}}"
package="
{{projectIdentifier
}}"
android:versionCode="1"
android:versionName="0.0.1">
...
...
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
View file @
2772f203
...
...
@@ -173,7 +173,7 @@ final String _infoPlistInitialContents = '''
<key>CFBundleExecutable</key>
<string>Runner</string>
<key>CFBundleIdentifier</key>
<string>
com.example.{{projectName
}}</string>
<string>
{{projectIdentifier
}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment