Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

studio-plugin min support 141.0;filter java-library #887

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions freeline-studio-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,30 @@ intellij {

// Uncomment to test against Android Studio
// intellij.alternativeIdePath = '/Applications/Android Studio.app'
}

project.tasks['patchPluginXml'].doLast {
//<idea-version since-build="162.2228" until-build="162.*"/>
//=>
//<idea-version since-build="141.0"/>

File xmlFile = project.file('build/patchedPluginXmlFiles/plugin.xml')

def ideaPlugin = new XmlParser().parse(new InputStreamReader(new FileInputStream(xmlFile.absolutePath), "utf-8"))

if (ideaPlugin) {
def ideaVersions = ideaPlugin['idea-version']
ideaVersions.findAll {
it.parent().remove(it)
}

ideaPlugin.appendNode('idea-version', ["since-build": "141.0"])

// Write the manifest file
def printer = new XmlNodePrinter(new PrintWriter(xmlFile.absolutePath, "utf-8"))
printer.preserveWhitespace = true
printer.print(ideaPlugin)

println("parse: ${xmlFile} \n<idea-version since-build=\"162.2228\" until-build=\"162.*\"/> \n=> \n<idea-version since-build=\"141.0\"/>")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static boolean isLibrary(GradleBuildFile file) {
if (file != null) {
List plugins = file.getPlugins();
if (plugins != null && plugins.size() > 0) {
return plugins.contains("com.android.library") || plugins.contains("android-library");
return !plugins.contains("com.android.application") && !plugins.contains("android");
}
}
return true;
Expand Down