Skip to content

Commit

Permalink
create resource adapters for litho plugin
Browse files Browse the repository at this point in the history
Reviewed By: cute-jumper

Differential Revision: D45840328

fbshipit-source-id: e11d1869891dc03708bc5ca041c9e9a5bc223923
  • Loading branch information
junliqin authored and facebook-github-bot committed May 16, 2023
1 parent 6aae8a3 commit 6014569
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 41 deletions.
7 changes: 5 additions & 2 deletions litho-intellij-plugin/BUCK
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
load("@fbsource//third-party/java/intellij:defs.bzl", "select_path_by_version")
load("@fbsource//tools/build_defs/intellij:plugin_rules.bzl", "plugin_rules")
load(
"//tools/build_defs/oss:litho_defs.bzl",
"fb_java_binary",
"make_dep_path",
)

fb_java_binary(
plugin_rules.intellij_plugin_binary(
name = "litho-intellij-plugin",
ide_version_blocklist = ["AI-213"],
meta_inf_directory = select_path_by_version("resources/{}/META-INF"),
tests = [
make_dep_path("litho-intellij-plugin/src/test/java/com/facebook/litho:test"),
],
Expand Down
58 changes: 58 additions & 0 deletions litho-intellij-plugin/resources/AI-212/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
~ Copyright (c) Meta Platforms, Inc. and affiliates.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude">
<id>com.facebook.litho.intellij</id>
<name>Litho</name>
<idea-version since-build="212" until-build="212.*"/>
<description>
<![CDATA[
<p><a href='https://fblitho.com/'>Litho</a> is a declarative UI framework for Android.
This plugin provides better Litho integration in Android Studio.
<p>The following features are available:
<ul>
<li>Command-click on a Section or Component takes you to Spec</li>
<li>Component usages in the search results</li>
<li>MountSpec, LayoutSpec, and GroupSectionSpec templates under File -> New menu</li>
<li>Completion for valid method annotations in LayoutSpec</li>
<li>Completion for ClickEvent handler</li>
<li>Completion for component builder</li>
<li>Error annotations for LayoutSpec</li>
<li>Error annotations for missing Required Props</li>
<li><code>@DefaultProp</code> value near the <code>@Prop</code> parameter as a folding</li>
<li>Regenerate Component action in Editor menu</li>
</ul>
]]>
</description>
<version>2021.2.0.1-SNAPSHOT</version>
<change-notes>
<![CDATA[
<h3>1.8.5</h3>
<ul>
<li>New: Required props autocompletion for KComponents and Litho widget wrappers</li>
<li>New: DiffSectionSpec Litho Structure View</li>
<li>Fix: Re-arrange litho actions in 'New' context menu</li>
<h3>Older Versions</h3>
<p>Check the <a href='https://github.com/facebook/litho/blob/master/litho-intellij-plugin/CHANGELOG.md'>Changelog</a> for full version history.
]]>
</change-notes>
<vendor url="https://github.com/facebook/litho/tree/master/litho-intellij-plugin">
Facebook,Inc.
</vendor>

<xi:include href="/META-INF/CommonPlugin.xml" xpointer="xpointer(/idea-plugin/*)" />

</idea-plugin>
57 changes: 57 additions & 0 deletions litho-intellij-plugin/resources/AI-222/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
~ Copyright (c) Meta Platforms, Inc. and affiliates.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude">
<id>com.facebook.litho.intellij</id>
<name>Litho</name>
<idea-version since-build="222" until-build="222.*"/>
<description>
<![CDATA[
<p><a href='https://fblitho.com/'>Litho</a> is a declarative UI framework for Android.
This plugin provides better Litho integration in Android Studio.
<p>The following features are available:
<ul>
<li>Command-click on a Section or Component takes you to Spec</li>
<li>Component usages in the search results</li>
<li>MountSpec, LayoutSpec, and GroupSectionSpec templates under File -> New menu</li>
<li>Completion for valid method annotations in LayoutSpec</li>
<li>Completion for ClickEvent handler</li>
<li>Completion for component builder</li>
<li>Error annotations for LayoutSpec</li>
<li>Error annotations for missing Required Props</li>
<li><code>@DefaultProp</code> value near the <code>@Prop</code> parameter as a folding</li>
<li>Regenerate Component action in Editor menu</li>
</ul>
]]>
</description>
<version>2022.2.0.1-SNAPSHOT</version>
<change-notes>
<![CDATA[
<h3>1.8.5</h3>
<ul>
<li>New: Required props autocompletion for KComponents and Litho widget wrappers</li>
<li>New: DiffSectionSpec Litho Structure View</li>
<li>Fix: Re-arrange litho actions in 'New' context menu</li>
<h3>Older Versions</h3>
<p>Check the <a href='https://github.com/facebook/litho/blob/master/litho-intellij-plugin/CHANGELOG.md'>Changelog</a> for full version history.
]]>
</change-notes>
<vendor url="https://github.com/facebook/litho/tree/master/litho-intellij-plugin">
Facebook,Inc.
</vendor>

<xi:include href="/META-INF/CommonPlugin.xml" xpointer="xpointer(/idea-plugin/*)" />
</idea-plugin>
57 changes: 57 additions & 0 deletions litho-intellij-plugin/resources/IC-223/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
~ Copyright (c) Meta Platforms, Inc. and affiliates.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude">
<id>com.facebook.litho.intellij</id>
<name>Litho</name>
<idea-version since-build="223" until-build="223.*"/>
<description>
<![CDATA[
<p><a href='https://fblitho.com/'>Litho</a> is a declarative UI framework for Android.
This plugin provides better Litho integration in Android Studio.
<p>The following features are available:
<ul>
<li>Command-click on a Section or Component takes you to Spec</li>
<li>Component usages in the search results</li>
<li>MountSpec, LayoutSpec, and GroupSectionSpec templates under File -> New menu</li>
<li>Completion for valid method annotations in LayoutSpec</li>
<li>Completion for ClickEvent handler</li>
<li>Completion for component builder</li>
<li>Error annotations for LayoutSpec</li>
<li>Error annotations for missing Required Props</li>
<li><code>@DefaultProp</code> value near the <code>@Prop</code> parameter as a folding</li>
<li>Regenerate Component action in Editor menu</li>
</ul>
]]>
</description>
<version>2022.3.0.1-SNAPSHOT</version>
<change-notes>
<![CDATA[
<h3>1.8.5</h3>
<ul>
<li>New: Required props autocompletion for KComponents and Litho widget wrappers</li>
<li>New: DiffSectionSpec Litho Structure View</li>
<li>Fix: Re-arrange litho actions in 'New' context menu</li>
<h3>Older Versions</h3>
<p>Check the <a href='https://github.com/facebook/litho/blob/master/litho-intellij-plugin/CHANGELOG.md'>Changelog</a> for full version history.
]]>
</change-notes>
<vendor url="https://github.com/facebook/litho/tree/master/litho-intellij-plugin">
Facebook,Inc.
</vendor>

<xi:include href="/META-INF/CommonPlugin.xml" xpointer="xpointer(/idea-plugin/*)" />
</idea-plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,6 @@
-->

<idea-plugin>
<id>com.facebook.litho.intellij</id>
<name>Litho</name>
<!-- 201 is Android Studio 4.1 -->
<idea-version since-build="201"/>
<description>
<![CDATA[
<p><a href='https://fblitho.com/'>Litho</a> is a declarative UI framework for Android.
This plugin provides better Litho integration in Android Studio.
<p>The following features are available:
<ul>
<li>Command-click on a Section or Component takes you to Spec</li>
<li>Component usages in the search results</li>
<li>MountSpec, LayoutSpec, and GroupSectionSpec templates under File -> New menu</li>
<li>Completion for valid method annotations in LayoutSpec</li>
<li>Completion for ClickEvent handler</li>
<li>Completion for component builder</li>
<li>Error annotations for LayoutSpec</li>
<li>Error annotations for missing Required Props</li>
<li><code>@DefaultProp</code> value near the <code>@Prop</code> parameter as a folding</li>
<li>Regenerate Component action in Editor menu</li>
</ul>
]]>
</description>
<version>1.8.7-SNAPSHOT</version>
<change-notes>
<![CDATA[
<h3>1.8.5</h3>
<ul>
<li>New: Required props autocompletion for KComponents and Litho widget wrappers</li>
<li>New: DiffSectionSpec Litho Structure View</li>
<li>Fix: Re-arrange litho actions in 'New' context menu</li>
<h3>Older Versions</h3>
<p>Check the <a href='https://github.com/facebook/litho/blob/master/litho-intellij-plugin/CHANGELOG.md'>Changelog</a> for full version history.
]]>
</change-notes>
<vendor url="https://github.com/facebook/litho/tree/master/litho-intellij-plugin">
Facebook,Inc.
</vendor>

<extensionPoints>
<extensionPoint name="eventLogger"
interface="com.facebook.litho.intellij.extensions.EventLogger" />
Expand Down

0 comments on commit 6014569

Please sign in to comment.