mirror of
https://github.com/revanced/smali.git
synced 2025-04-30 14:44:26 +02:00
Conditionally add the smalidea project to the root project
The smalidea project is only added when you're actually in the smalidea directory
This commit is contained in:
parent
ff4c85c5e4
commit
29d714f71f
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,4 +9,3 @@
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea
|
||||
/smalidea/.gradle
|
||||
|
@ -97,7 +97,8 @@ subprojects {
|
||||
version = parent.version
|
||||
|
||||
ext {
|
||||
depends = [guava: 'com.google.guava:guava:18.0',
|
||||
depends = [
|
||||
guava: 'com.google.guava:guava:18.0',
|
||||
findbugs: 'com.google.code.findbugs:jsr305:1.3.9',
|
||||
junit: 'junit:junit:4.6',
|
||||
antlr_runtime: 'org.antlr:antlr-runtime:3.5.2',
|
||||
@ -107,7 +108,8 @@ subprojects {
|
||||
jflex: 'de.jflex:jflex:1.4.3',
|
||||
jflex_plugin: 'co.tomlee.gradle.plugins:gradle-jflex-plugin:0.0.2',
|
||||
proguard_gradle: 'net.sf.proguard:proguard-gradle:5.2.1',
|
||||
dx: 'com.google.android.tools:dx:1.7'
|
||||
dx: 'com.google.android.tools:dx:1.7',
|
||||
gson: 'com.google.code.gson:gson:2.3.1'
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1 +1,5 @@
|
||||
include 'util', 'dexlib2', 'baksmali', 'smali', 'dexlib2:accessorTestGenerator'
|
||||
|
||||
if (System.getProperty("user.dir").startsWith(file("smalidea").absolutePath)) {
|
||||
include 'smalidea'
|
||||
}
|
@ -37,7 +37,6 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.0.40'
|
||||
classpath 'org.eclipse.jgit:org.eclipse.jgit:2.0.0.201206130900-r'
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,64 +117,47 @@ if (!('idea' in gradle.startParameter.taskNames)) {
|
||||
if (gradle.startParameter.taskNames.size() > 1) {
|
||||
throw new InvalidUserDataException("The idea task must be run by itself.")
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'org.smali:smali:2.1.2-205bf333'
|
||||
compile 'org.antlr:antlr-runtime:3.5.2'
|
||||
compile 'com.google.code.gson:gson:2.3.1'
|
||||
|
||||
antlr 'org.antlr:antlr:3.5.2'
|
||||
}
|
||||
|
||||
idea {
|
||||
project(':') {
|
||||
idea {
|
||||
project {
|
||||
jdkName = 'IDEA Plugin jdk'
|
||||
languageLevel 1.7
|
||||
|
||||
vcs = 'Git'
|
||||
|
||||
ipr {
|
||||
withXml {
|
||||
def node = it.asNode()
|
||||
|
||||
node.find { it.@name == 'ProjectRootManager' }
|
||||
.@'project-jdk-type' = 'IDEA JDK'
|
||||
|
||||
node.find { it.@name == 'VcsDirectoryMappings' }
|
||||
.mapping.@directory = '$PROJECT_DIR$/..'
|
||||
/*node.find { it.@name == 'ProjectRootManager' }
|
||||
.@'project-jdk-type' = 'IDEA JDK'*/
|
||||
|
||||
def componentNode = node.find { it.@name == 'ProjectRunConfigurationManager' }
|
||||
|
||||
if (componentNode == null) {
|
||||
componentNode = it.node.appendNode 'component', [name: 'ProjectRunConfigurationManager']
|
||||
}
|
||||
|
||||
if (componentNode.find { it.@name == 'All tests' } == null) {
|
||||
if (componentNode.find { it.@name == 'All smalidea tests' } == null) {
|
||||
componentNode.append(new XmlParser().parseText("""
|
||||
<configuration default="false" name="All tests" type="JUnit" factoryName="JUnit">
|
||||
<configuration default="false" name="All smalidea tests" type="JUnit" factoryName="JUnit">
|
||||
<extension name="coverage" enabled="false" merge="false" runner="idea" />
|
||||
<module name="smalidea" />
|
||||
<option name="TEST_OBJECT" value="directory" />
|
||||
<option name="VM_PARAMETERS" value="-Didea.system.path=${buildDir}/sandbox/config -Didea.system.path=${buildDir}/sandbox/system-test -Didea.load.plugins.id=org.jf.smalidea" />
|
||||
<option name="WORKING_DIRECTORY" value="file://\$PROJECT_DIR\$" />
|
||||
<option name="WORKING_DIRECTORY" value="file://\$PROJECT_DIR\$/smalidea" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<option name="TEST_SEARCH_SCOPE">
|
||||
<value defaultName="moduleWithDependencies" />
|
||||
</option>
|
||||
<dir value="\$PROJECT_DIR\$/src/test/java" />
|
||||
<dir value="\$PROJECT_DIR\$/smalidea/src/test/java" />
|
||||
</configuration>"""))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
jdkName = 'IDEA Plugin jdk'
|
||||
|
||||
excludeDirs -= buildDir
|
||||
if (buildDir.exists()) {
|
||||
excludeDirs.addAll(buildDir.listFiles())
|
||||
@ -199,16 +181,30 @@ idea {
|
||||
def pluginNode = node.find { it.@name == 'DevKit.ModuleBuildProperties' }
|
||||
if (pluginNode == null) {
|
||||
node.appendNode 'component', [name: 'DevKit.ModuleBuildProperties',
|
||||
url: pluginUrl]
|
||||
url : pluginUrl]
|
||||
} else {
|
||||
pluginNode.@url = pluginUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task extractTokens(type: org.gradle.api.tasks.Copy) {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':smali')
|
||||
compile depends.antlr_runtime
|
||||
compile depends.gson
|
||||
|
||||
antlr depends.antlr
|
||||
}
|
||||
|
||||
task extractTokens(type: org.gradle.api.tasks.Copy, dependsOn: ':smali:build') {
|
||||
def allArtifacts = configurations.default.resolvedConfiguration.resolvedArtifacts
|
||||
def smaliArtifact = allArtifacts.find { it.moduleVersion.id.name.equals('smali') }
|
||||
|
||||
@ -230,3 +226,7 @@ ideaModule.dependsOn(generateGrammarSource)
|
||||
|
||||
task release(dependsOn: ':buildPlugin') {
|
||||
}
|
||||
|
||||
tasks.getByPath('idea').dependsOn(project(':').getTasksByName('idea', true).findAll({
|
||||
it.project.name != 'smalidea'
|
||||
}))
|
Loading…
x
Reference in New Issue
Block a user