You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous builder for the Flutter plugin was written in Ant. An expert in Ant would probably have no trouble maintaining it, but we have no such expert available. In order to increase stability and productivity we transformed the builder into a Dart command line tool, inspired by the Flutter tool. The tool is named `plugin`, since it helps with plugin development.
5
-
3
+
The previous builder for the Flutter plugin was written in Ant. An expert in Ant would probably have no trouble maintaining it, but we have
4
+
no such expert available. In order to increase stability and productivity we transformed the builder into a Dart command line tool, inspired
5
+
by the Flutter tool. The tool is named `plugin`, since it helps with plugin development.
6
6
7
7
## Functions
8
8
9
-
The tool needs to perform several functions. Building is the basic one, but others are important too. Implementation note: these will be implemented as compound commands in the CLI tool (similar to `flutter doctor` or `flutter run` in the Flutter CLI tool).
9
+
The tool needs to perform several functions. Building is the basic one, but others are important too. Implementation note: these will be
10
+
implemented as compound commands in the CLI tool (similar to `flutter doctor` or `flutter run` in the Flutter CLI tool).
10
11
11
-
*`make`
12
-
*`test`
13
-
*`deploy`
14
-
*`generate`
15
-
*`lint`
12
+
*`deploy`
13
+
*`generate`
14
+
*`lint`
16
15
17
16
Each command has its own set of optional arguments. If the CLI tool is invoked without a command then it will print its help message.
18
17
19
18
There are two global options. On the command line these are given prior to the command name.
20
19
21
-
22
-
23
-
*`-r, --release=XX`
24
-
Use "release mode." The `XX` value specifies the release identifier, like 18 or 19.1. It will be shown in the "version" field of the plugin manager's listing for the Flutter plugin. In this mode additional constraints must be satisfied. The current git branch must have no unsaved changes and must be named "release_XX". The `.github/workflows/presubmit.yaml` file must be newer than the `product-matrix.json` file (see the `generate` command).
25
-
*`-d, --cwd=<working-directory>`
26
-
Set the root directory to the `working-directory` value. This should not be used when running the tool from the command line. It is only intended to be used when running tests from IntelliJ run configurations that have no way to specify the working directory.
27
-
28
-
29
-
### Make
30
-
31
-
Builds may be targeted for local development or distribution.
32
-
33
-
34
-
35
-
*`-[no-]ij`
36
-
Build for IntelliJ. Default is true; may be negated by including `no`.
37
-
*`-[no-]as`
38
-
Build for Android Studio. Default is true; may be negated by including `no`.
39
-
*`-o, --only-version=ID`
40
-
Only build the specified IntelliJ version. `ID` is one of the "version" strings in product-matrix.json.
41
-
*`-u, --unpack`
42
-
Normally the archive files are not unpacked if the corresponding directory exists. This flag forces the archive files to be unpacked.
43
-
44
-
45
-
The make function must generate the correct `plugin.xml` for each platform and generate the correct artifacts for each. In release mode the archive files are always unpacked (--unpack is implied). The plugin files are saved in the `artifacts` directory. In release mode a subdirectory of `artifacts` is created which has the name of the release and they are put there. During a local dev/test run the subdirectory is not created and the created files are children of `artifacts`.
46
-
47
-
Returns a success or failure code to play nice with shell commands.
48
-
49
-
50
-
### Test
51
-
52
-
Both unit and integration tests need to run, and tests should work whether running locally or on Travis.
53
-
54
-
55
-
56
-
* `-u, --[no-]unit
57
-
`Run unit tests (or not).
58
-
*`-i, --[no-]integration`
59
-
Run GUI-based integration tests (or not).
60
-
61
-
TBD: We may need some mechanism to automatically upload testing artifacts, since we can no longer attach zip files to email. This could also potentially be addressed by creating a 'dev' channel for the plugin on the JetBrains store, and publishing to it when we have release candidates.
62
-
20
+
*`-r, --release=XX`
21
+
Use "release mode." The `XX` value specifies the release identifier, like 18 or 19.1. It will be shown in the "version" field of the
22
+
plugin manager's listing for the Flutter plugin. In this mode additional constraints must be satisfied. The current git branch must have
23
+
no unsaved changes and must be named "release_XX". The `.github/workflows/presubmit.yaml` file must be newer than the
24
+
`product-matrix.json` file (see the `generate` command).
25
+
*`-d, --cwd=<working-directory>`
26
+
Set the root directory to the `working-directory` value. This should not be used when running the tool from the command line. It is only
27
+
intended to be used when running tests from IntelliJ run configurations that have no way to specify the working directory.
63
28
64
29
### Deploy
65
30
66
-
Automatically upload all required artifacts to the JetBrains site. This function will print instructions to retrieve the password from valentine then prompt for the password to log into the JetBrains site. It has no options. Returns a success or failure code to play nice with shell commands.
31
+
Automatically upload all required artifacts to the JetBrains site. This function will print instructions to retrieve the password from
32
+
valentine then prompt for the password to log into the JetBrains site. It has no options. Returns a success or failure code to play nice
33
+
with shell commands.
67
34
(Used primarily by the dev channel Kokoro job. Not sure if it works for uploading to the stable channel.)
68
35
69
36
### Generate
70
37
71
-
Generate a `plugin.xml` from `plugin.xml.template` to be used for launching a runtime workbench. This is different from the ones generated during building because it will have a version range that allows use in all targeted platforms.
72
-
38
+
This is now only used for live templates (see `resources/liveTemplates`).
73
39
74
40
### Lint
75
41
76
42
Run the lint tool. It checks for bad imports and prints a report of the Dart plugin API usage.
77
43
78
-
79
-
## Examples
80
-
81
-
Build the Flutter plugin for IntelliJ and Android Studio, in distribution mode.
82
-
83
-
`plugin -r19.2 make`
84
-
85
-
Build a local version of the IntelliJ version of the plugin, not for distribution.
86
-
87
-
`plugin make --no-as`
88
-
89
-
Run integration tests without doing a build, assuming an edit-build-test cycle during development.
90
-
91
-
`plugin test --no-unit`
92
-
93
-
Build everything then run all tests. The big question here is: Can we get integration tests to run using the newly-built plugin rather than sources?
94
-
95
-
`plugin make && plugin test`
96
-
97
44
## Debugging
98
45
99
-
It can be difficult to debug issues that only occur with a deployable
100
-
plugin built by `plugin make`. Here's how to set up remote
101
-
debugging with IntelliJ:
46
+
It can be difficult to debug issues that only occur with a deployable plugin. Here's how to set up remote debugging with IntelliJ:
102
47
103
-
In IntelliJ create a "Remote" type of run configuration. It
104
-
shows you the command-line arg you need to add in the top
105
-
text field of the run config. Copy that text.
48
+
In IntelliJ create a "Remote" type of run configuration. It shows you the command-line arg you need to add in the top text field of the run
49
+
config. Copy that text.
106
50
107
-
Now, (assuming you are on a Mac) find your IJ or AS app in
108
-
the Finder. Right-click, 'Show Package Contents', open
109
-
Contents, edit Info.plist. In the plist editor expand
110
-
JVMOptions and then edit VMOptions. Append the copied text
111
-
to the end. Save the plist editor and launch the AS or IJ app.
51
+
Now, (assuming you are on a Mac) find your IJ or AS app in the Finder. Right-click, 'Show Package Contents', open Contents, edit Info.plist.
52
+
In the plist editor expand JVMOptions and then edit VMOptions. Append the copied text to the end. Save the plist editor and launch the AS or
53
+
IJ app.
112
54
113
-
Back in IntelliJ, select your new run config and click the
114
-
debug icon to attach the debugger to the app. The copied
115
-
text includes "suspend=n". If you want to set a breakpoint
116
-
before execution begins change that 'n' to 'y'.
55
+
Back in IntelliJ, select your new run config and click the debug icon to attach the debugger to the app. The copied text includes "
56
+
suspend=n". If you want to set a breakpoint before execution begins change that 'n' to 'y'.
0 commit comments