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
f526805e
Unverified
Commit
f526805e
authored
Feb 17, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Feb 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix of flutter packages get in plugin project (#14757)
parent
d4e97335
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
16 deletions
+32
-16
project.dart
packages/flutter_tools/lib/src/project.dart
+3
-7
packages_test.dart
packages/flutter_tools/test/commands/packages_test.dart
+18
-0
project_test.dart
packages/flutter_tools/test/project_test.dart
+6
-6
common.dart
packages/flutter_tools/test/src/common.dart
+5
-3
No files found.
packages/flutter_tools/lib/src/project.dart
View file @
f526805e
...
...
@@ -56,16 +56,12 @@ class FlutterProject {
/// Generates project files necessary to make Gradle builds work on Android
/// and CocoaPods+Xcode work on iOS.
void
ensureReadyForPlatformSpecificTooling
()
{
if
(!
directory
.
existsSync
())
{
if
(!
directory
.
existsSync
()
||
isPluginProject
)
{
return
;
}
if
(
isPluginProject
)
{
example
.
ensureReadyForPlatformSpecificTooling
();
}
else
{
injectPlugins
(
directory:
directory
.
path
);
generateXcodeProperties
(
directory
.
path
);
}
}
}
/// Represents the contents of the ios/ folder of a Flutter project.
...
...
packages/flutter_tools/test/commands/packages_test.dart
View file @
f526805e
...
...
@@ -192,6 +192,24 @@ void main() {
// TODO(mravn): This test fails on the Chrome windows bot only.
// Skipping until resolved.
},
timeout:
allowForRemotePubInvocation
,
skip:
true
);
testUsingContext
(
'get fetches packages and injects plugin in plugin project'
,
()
async
{
final
String
projectPath
=
await
createProject
(
temp
,
arguments:
<
String
>[
'-t'
,
'plugin'
,
'--no-pub'
],
);
final
String
exampleProjectPath
=
fs
.
path
.
join
(
projectPath
,
'example'
);
removeGeneratedFiles
(
projectPath
);
removeGeneratedFiles
(
exampleProjectPath
);
await
runCommandIn
(
projectPath
,
'get'
);
expectDependenciesResolved
(
projectPath
);
await
runCommandIn
(
exampleProjectPath
,
'get'
);
expectDependenciesResolved
(
exampleProjectPath
);
expectPluginInjected
(
exampleProjectPath
);
},
timeout:
allowForRemotePubInvocation
);
});
group
(
'packages test/pub'
,
()
{
...
...
packages/flutter_tools/test/project_test.dart
View file @
f526805e
...
...
@@ -23,6 +23,12 @@ void main() {
project
.
ensureReadyForPlatformSpecificTooling
();
expect
(
project
.
directory
.
existsSync
(),
isFalse
);
});
testInMemory
(
'does nothing in plugin root project'
,
()
async
{
final
FlutterProject
project
=
aPluginProject
();
project
.
ensureReadyForPlatformSpecificTooling
();
expect
(
project
.
example
.
ios
.
directory
.
childFile
(
'Runner/GeneratedPluginRegistrant.h'
).
existsSync
(),
isFalse
);
expect
(
project
.
example
.
ios
.
directory
.
childFile
(
'Flutter/Generated.xcconfig'
).
existsSync
(),
isFalse
);
});
testInMemory
(
'injects plugins'
,
()
async
{
final
FlutterProject
project
=
aProjectWithIos
();
project
.
ensureReadyForPlatformSpecificTooling
();
...
...
@@ -33,12 +39,6 @@ void main() {
project
.
ensureReadyForPlatformSpecificTooling
();
expect
(
project
.
ios
.
directory
.
childFile
(
'Flutter/Generated.xcconfig'
).
existsSync
(),
isTrue
);
});
testInMemory
(
'generates files in plugin example project'
,
()
async
{
final
FlutterProject
project
=
aPluginProject
();
project
.
ensureReadyForPlatformSpecificTooling
();
expect
(
project
.
example
.
ios
.
directory
.
childFile
(
'Runner/GeneratedPluginRegistrant.h'
).
existsSync
(),
isTrue
);
expect
(
project
.
example
.
ios
.
directory
.
childFile
(
'Flutter/Generated.xcconfig'
).
existsSync
(),
isTrue
);
});
});
group
(
'organization names set'
,
()
{
testInMemory
(
'is empty, if project not created'
,
()
async
{
...
...
packages/flutter_tools/test/src/common.dart
View file @
f526805e
...
...
@@ -88,13 +88,15 @@ Matcher throwsProcessExit([dynamic exitCode]) {
/// Matcher for [ProcessExit]s.
const
Matcher
isProcessExit
=
const
isInstanceOf
<
ProcessExit
>();
/// Creates a flutter project in the [temp] directory.
/// Creates a flutter project in the [temp] directory using the
/// [arguments] list if specified, or `--no-pub` if not.
/// Returns the path to the flutter project.
Future
<
String
>
createProject
(
Directory
temp
)
async
{
Future
<
String
>
createProject
(
Directory
temp
,
{
List
<
String
>
arguments
})
async
{
arguments
??=
<
String
>[
'--no-pub'
];
final
String
projectPath
=
fs
.
path
.
join
(
temp
.
path
,
'flutter_project'
);
final
CreateCommand
command
=
new
CreateCommand
();
final
CommandRunner
<
Null
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectPath
]
);
await
runner
.
run
(<
String
>[
'create'
]..
addAll
(
arguments
)..
add
(
projectPath
)
);
return
projectPath
;
}
...
...
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