Commit graph

100 commits

Author SHA1 Message Date
Michael Thomsen 7a57d37195 Add Pods cache dir to ios/.gitignore (#9464)
* Add Pods cache dir to ios/.gitngnore

* Add missing ending newlines
2017-04-21 13:18:05 +02:00
Michael Thomsen 3510082ac9 Better separation between app and plugin main.dart and fix plugin main.dart issues. (#9491)
* Make seperation between app and plugin main.dart more manageable.

* Jakob review feedback

* Remove empty line

* Add missing newline
2017-04-21 12:49:42 +02:00
Mikkel Nygaard Ravn 79afc77594 Plugin template uses new channel name (#9453) 2017-04-18 22:54:01 +02:00
Michael Thomsen 8bf97cc42a Add iOS deployment target to podspec template (#9281) 2017-04-18 15:48:31 +02:00
Mikkel Nygaard Ravn 945cfc3ee2 Make naming consistent across channel APIs (#9270) 2017-04-18 15:23:15 +02:00
Phil Quitslund 1df6917b60 Update project creation IDEA metadata (flutter-intellij#914) (#9422)
Fixes: https://github.com/flutter/flutter-intellij/issues/914
2017-04-17 11:42:44 -07:00
Brian Slesinsky cedc9fb2ea fix issue where Flutter for Android library would disappear (#9404)
IDEA gets confused unless the filename matches the project library name,
including getting the case right.
2017-04-14 20:27:44 -07:00
Brian Slesinsky 5cb9097965 flutter create: enable Java support in IDEA (#9335)
Generates an android.iml file and a package-level library for flutter.jar.

Does not set up an Android SDK in IDEA; this isn't possible with a
template-based approach. But IDEA shows a clear warning, so the
user can fix this by setting the SDK.

(When creating a Flutter project from within IDEA, we can fix this up
afterwards in the plugin.)
2017-04-14 10:12:48 -07:00
xster 89a7fdfc56 Rename State.config to widget everywhere (#9273)
Rename State.config to State.widget
Rename State.didUpdateConfig to State.didUpdateWidget
Renamed all State subclasses' local variables named config to something else
2017-04-10 18:32:24 -07:00
Jakob Andersen 7ffa82aaf0 Inject plugin registration. (#9216)
Added a PluginRegistry to the new project template. The registry files will be automatically updated at build time to register the native plugins.

Fixes #7814.
2017-04-10 15:44:19 +02:00
Seth Ladd c358ddbaf2 example of a package dependency asset (#9295) 2017-04-07 17:51:34 -07:00
Ian Hickson a52c7b470d Update the examples/ README and associated fixes. (#9090)
This yak shave went as follows:

Fix https://github.com/flutter/flutter/issues/8795 by adding stocks to
the examples README.

Notice the layers entry in that README isn't quite right either.
Update that.

Check the layers/README file is worth pointing at.

Update the layers/README.

Let's run some of the layer tests to see if they still work.

Oops, need to update them to gradle.

Ok let's try running them again.

Oops, sector is broken.

Add a test for sector.

Fix sector. Find you need to add an assert to a const constructor.

Notice we need to turn const asserts on for the analyzer.

Notice the analysis_options files are out of sync with each other and
with the full list of lints.

Turn on the lints that should be on.

Fix the bugs that finds.
2017-04-05 11:28:33 -07:00
Collin Jackson 244a7a02b5 rename initWithFlutterView to initWithController (#9208) 2017-04-05 08:21:36 -07:00
Jakob Andersen 5541d71b11 Android: Set evaluationDependsOn for plugin subprojects. (#9179)
Gradle projects are evaluated in lexicographical order, and the plugin
projects are at the same level as the :app project, so if a plugin has
a name that comes before 'app' (like, for example, any name that starts
with a capital letter), the plugin project will be evaluated before
:app.

Since :app applies the Flutter Gradle plugin, which tries to
modify the dependencies of the plugin projects, we have a problem if the
plugin projects have already been evaluated. Adding
evaluationDependsOn(':app') to the plugin projects fixes this.

Updated example projects to the latest (plugin-enabled) Gradle build
files.

Also removed two unused imports in `pluginClass.java.tmpl`.
2017-04-04 13:03:06 +02:00
Collin Jackson 9095d76299 remove support library dependency in plugin template (#9126) 2017-04-03 05:17:24 -07:00
Devon Carew 01d48c9961 update the flutter create template for IntelliJ 2017.1 (#9106) 2017-03-30 13:53:22 -07:00
Jakob Andersen 104e7ba576 Update plugin template to new channel API. (#9105) 2017-03-30 21:25:31 +02:00
Michael Thomsen cf98008475 Fix path in modules.xml to match new location of .iml (#9100) 2017-03-30 14:13:07 +02:00
Jakob Andersen f34f8a3197 Add template for plugin projects. (#9076)
Plugin projects are created by running `flutter create --plugin <name>`.

An example app is also created in the plugin project, using the normal 'create' template, which has been modified to allow for conditional plugin code.

Modified the android package name to match package naming conventions (all lower-case, and must match the directory name).
2017-03-30 12:39:21 +02:00
Jakob Andersen b61e169011 Automatically wire dependencies for native plugins (#8891)
Go through all packages brought in by pub, and write the name and path of every one that is a flutter plugin into .flutter-plugins.

In android/settings.gradle and ios/Podfile, read in .flutter-plugins, if that file exists. The Android / iOS code from the plugins is automatically added as dependencies of the native code of the app.
2017-03-23 14:59:12 +01:00
Chris Bracken 0ee3f57a10 Build Flutter app as a framework on iOS (#8971)
**THIS IS A BREAKING CHANGE.** See below for migration steps for
existing projects.

Previously, Flutter app code was built as a raw dylib on iOS.  Dynamic
libraries outside of a framework bundle are not supported on iOS, except
for the system Swift libraries provided by Xcode.

See:
https://developer.apple.com/library/content/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING_BUNDLE_ERRORS-EMBEDDED__DYLIB_FILES

* Migrates Xcode build from app.dylib to App.framework
* Migrates flutter create template
* Migrates example projects

Migration steps for existing projects
=====================================

The following steps should be taken from the root of your Flutter
project:

1. Edit `ios/.gitignore`: add `/Flutter/App.framework` on a new line.
2. In the Xcode project navigator, remove `app.dylib` from the Flutter
   folder. Delete this file from the `ios/Flutter` directory in your project.
3. Run a build to generate `ios/Flutter/App.framework`. From the command
   line, run `flutter build ios`. If you have not configured app signing
   in Xcode, an alternative method is to open the simulator, then run
   `flutter run -d iP`.
4. In the Xcode project navigator, select the `Runner` project. In the
   project settings that are displayed in the main view, ensure that the
   `Runner` target is selected. You can verify this by exposing the
   sidebar using the [| ] icon in the upper-left corner of the main
   view.
5. Select the *General* tab in the project settings. Under the
   *Embedded Binaries* section, click '+' to add `App.framework`. In the
   sheet that drops down, click the *Add Other...* button. Navigate to
   the `ios/Flutter` directory and select `App.framework`. Click *Open*.
   In the sheet that drops down, select *Create folder references*, then
   click *Finish*.
6. In the project settings, verify that `App.framework` has been added to the
   *Embedded Binaries* and *Linked Frameworks and Libraries* lists.
7. In the Xcode project navigator, drag `App.framework` under the
   Flutter folder.
8. In the Xcode project navigator, select `Flutter` then from the
   *File* menu, select *Add Files to "Runner"...*. Navigate to the
   `ios/Flutter` directory, select `AppFrameworkInfo.plist` and click
   the *Add* button.
9. From the command line, in your project directory, run
   `flutter build clean`, then `flutter run`.

At this point your project should be fully migrated.
2017-03-22 17:41:49 -07:00
Michael Thomsen 15e51a9e3e Revert "Update gradle wrapper and build-tools version for flutter create." (#8940)
* Revert "use color.shadeXxx instead of color[Xxx] (#8932)"

This reverts commit 578ca0a295.

* Revert "add missing const keyword (#8931)"

This reverts commit fac2fac1d6.

* Revert "Make min/max fling velocity and min fling distance ScrollPhysics properties (#8928)"

This reverts commit dac80aac89.

* Revert "Defer to operating system for whichAll (#8921)"

This reverts commit 14933de986.

* Revert "Update gradle wrapper and build-tools version for flutter create. (#8914)"

This reverts commit deb71cc6dc.
2017-03-21 17:42:40 -07:00
asaarnak deb71cc6dc Update gradle wrapper and build-tools version for flutter create. (#8914)
* Update gradle wrapper and build-tools version.

Tested manually by "flutter create" with Idea "flutter run" and from android studio "run" android app.

* Update com.android.tools.build to 2.3.0
2017-03-21 16:47:32 +01:00
Jakob Andersen 1457f3dbb0 Put Gradle output in build/ (#8759)
Changed the default build output directory in the new project template
to build/, instead of android/build/ and android/app/build/.

Updated tools to ask the Gradle scripts what the build directory is,
since this is configurable in the build scripts, and we need to know
where the build output actually is.

Silenced output from 'flutter build aot' when invoked from Gradle, since
the output was confusing in this case.

Fixes #8723
Fixes #8656
Fixes #8138
2017-03-15 10:53:22 +01:00
Chris Bracken a4125f3b0e Declare Xcode 8.3.x compatibility in project files (#8622)
Update templates and example Xcode project files to indicate they've
been tested for Xcode 8.3 compatibility.
2017-03-07 13:11:41 -08:00
Chris Bracken bd3aac7043 Use default iOS SDK for CocoaPods project (#8603)
This matches the default for Runner.xcodeproj and fixes a linker warning
when the two projects use different values.
2017-03-06 17:31:51 -08:00
Chris Bracken 752ca59dff Update iOS template icon assets (#8601)
Add 20x20 notification icons.
Remove unused 76x76 (3x scale) icon.
Fixes warnings for missing/unused icon assets in Xcode 8.2.x
2017-03-06 17:05:27 -08:00
Chris Bracken d32dc9254b Update Xcode projects to 8.2.x (#8596)
This prevents project re-validation on initial Xcode launch.
2017-03-06 14:50:41 -08:00
Michael Thomsen 3cf1ea6dc5 Small update to instructional comments in app template (#8468)
* Small update to instructional comments in app template

* Update Flutter Driver comment

Good suggestion to add the link, Seth! I also updated the working to match what that page uses.
2017-03-06 12:36:45 -08:00
Michael Thomsen 0533ffc020 Upgrade build tools to latest Android Studio default (#8461) 2017-02-28 18:25:28 +01:00
Michael Thomsen 8857fa080e Revert back IntelliJ .iml file to project root (#8139)
* Move .iml file back to project root directory

* Update .iml location in all examples
2017-02-14 18:15:26 +01:00
Jakob Andersen b246c5e7e9 Make new project template gradle-based for Android. (#7902)
* Make new project template gradle-based for Android.

With this change, the 'new project' template uses the same gradle-based build for Android as the hello_services example. This has some implications on build performance, since we're now building a complete Android app instead of just combining a pre-compiled .dex with the Flutter assets.

The very first build is a little over 2x slower, since it needs to download gradle and build the build scripts before getting to the actual code. Subsequent builds with changes to the code are comparable to the old builds. Null builds are faster. Enabling the gradle daemon speeds up subsequent builds by around 5s.

* Move Flutter Gradle plugin to Flutter root.
2017-02-10 09:37:38 +01:00
Chris Bracken 5e672cbe64 Update Xcode project templates to handle paths with spaces (#8034) 2017-02-09 13:25:29 -08:00
Chris Bracken 1926d11188 Thin iOS app frameworks to the target architecture (#7913)
* Support thinning iOS frameworks to supported architectures

When building against frameworks that are distributed as
multi-architecture fat binaries, we want to strip the frameworks we
distribute down to only the architectures specified in $ARCHS.

This patch adds:
* The ability to specify commands to xcode_backend.sh (if none is
  specified, run BuildApp for backward compatibility).
* A 'thin' command that invokes lipo to thin down the distributed as
  described above.

* Add framework thinning step to iOS build

Invokes xcode_backend.sh thin on the build application.

* Limit architectures to arm64 in Xcode template

Flutter does not yet support armv7 iOS devices. Limit the $ARCHS build
variable to arm64 until then.
2017-02-07 12:04:36 -08:00
Chris Bracken aaff608d05 Use FlutterAppDelegate in iOS create template (#7845)
On iOS, generate a FlutterAppDelegate subclass for the application
delegate. This avoids touchesBegan:withEvent boilerplate to handle
status bar taps.
2017-02-02 18:03:56 -08:00
Chris Bracken 2bbc028313 Add touchesBegan handler to iOS AppDelegate template (#7822)
By default, pass status bar taps to the root view controller in
generated Flutter apps. Developers should customise as necesary if they
later create one or more alternate FlutterViewControllers that they'd
like to forward these to.
2017-02-02 12:50:01 -08:00
Chris Bracken d01c55d289 Eliminate calls to deprecated FlutterInit() (#7770) 2017-01-31 17:39:29 -08:00
Ian Hickson 1bdf351818 Merge pubspec.yaml and flutter.yaml. (#7605) 2017-01-24 11:19:31 -08:00
Michael Thomsen 24f1b2ee09 Update IntelliJ template for new projects and existing samples (#7501)
* Disable 'Show Excluded' by default

* Move .iml file inside .idea dir

* Remove pub and build excludions as they are automatically set by the Dart plugin

* Exclude .idea folder (new users will edit it through the IJ UI, not the file)

* Move .iml files into .idea dir to be consistent with template changes

* Add workspace.xml from new template to existing samples

* Update current examples to match template changes for excluding folders

* Add missing flutter.yaml to make sure there are no analysis errors

* Add back .pub and build excludeFolder tags per https://github.com/flutter/flutter-intellij/issues/630#issuecomment-272887230

* Remove workspace.xml from example per review feedback
2017-01-23 16:33:18 +01:00
Michael Thomsen b71f89a194 Add a workspace file to the template to trigger main.dart to open in the code editor (#7464) 2017-01-12 22:50:17 +01:00
Devon Carew 3759332890 update create template intellij metadata (#7255) 2016-12-14 03:42:55 -08:00
Collin Jackson 211fefc217 rename Sky to Flutter and add clarifying comment to template (#7165)
* s/sky/flutter/ in Android templates

* update engine.version with a compatible engine version

* replace more SkyActivity references with FlutterActivity
2016-12-06 16:03:32 -08:00
Collin Jackson 9f3c3fd2dc Fix #7029 nested .gitignore breaks ios projects (#7045) 2016-11-28 10:02:00 -08:00
Joel Trottier-Hebert 6d8141b242 Added comment for INTERNET permission in Android manifest (#6835)
* Added comment for INTERNET permission in Android manifest

* Added more details to the permission comment.
2016-11-17 15:04:57 -08:00
Ian Hickson fa2caa737b Tweaks to the template for P4. (#6635) 2016-11-02 11:28:49 -07:00
Devon Carew b9e7ee88d8 Remove atom check (#6605)
* remove the validator check for atom

* remove the atom launch config

* review comments
2016-11-01 11:46:30 -07:00
Ian Hickson 5ded244d55 flutter create template: build comment (#6611) 2016-10-31 21:59:20 -07:00
Ian Hickson 5032019f39 Include widget configuration in the template (#6476)
This should help new users figure out how to set up their constructors
and use config data from the build method of a State.
2016-10-24 11:26:30 -07:00
Ian Hickson fad62d4164 Update the flutter create template. (#6443)
This tries to capture some of the experience of usability study
participant P1.
2016-10-20 20:44:14 -04:00
Devon Carew f1d70fcdd3 create intellij metadata from flutter create (#6429) 2016-10-20 12:03:38 -07:00