mirror of
https://gitee.com/replugin/RePlugin.git
synced 2024-11-30 02:38:34 +08:00
* add variant param
This commit is contained in:
parent
3ae4425476
commit
8c7b3f6f7b
@ -62,7 +62,7 @@ public class Replugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
output.processResources.doFirst {
|
||||
new FileCreators().init(project, config).create()
|
||||
new FileCreators().init(project, variant, config).create()
|
||||
}
|
||||
|
||||
output.processManifest.doLast {
|
||||
|
@ -28,12 +28,12 @@ public class FileCreators {
|
||||
|
||||
def creators
|
||||
|
||||
def init(Project project, def config) {
|
||||
def init(Project project, def variant, def config) {
|
||||
creators = []
|
||||
creators << new RePluginHostConfigCreator(project, config)
|
||||
creators << new RePluginHostConfigCreator(project, variant, config)
|
||||
|
||||
if (config.autoManageBuiltInJsonFile) {
|
||||
creators << new PluginBuiltinJsonCreator(project, config)
|
||||
creators << new PluginBuiltinJsonCreator(project, variant, config)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import com.android.build.gradle.AppExtension
|
||||
import com.android.build.gradle.api.AndroidSourceSet
|
||||
import com.qihoo360.replugin.gradle.host.creator.IFileCreator
|
||||
import org.gradle.api.NamedDomainObjectContainer
|
||||
|
||||
/**
|
||||
* @author RePlugin Team
|
||||
*/
|
||||
@ -30,11 +31,13 @@ public class RePluginHostConfigCreator implements IFileCreator {
|
||||
|
||||
def config
|
||||
def project
|
||||
def variant
|
||||
def fileDir
|
||||
def fileName
|
||||
|
||||
def RePluginHostConfigCreator(def project, def cfg) {
|
||||
def RePluginHostConfigCreator(def project, def variant, def cfg) {
|
||||
this.project = project
|
||||
this.variant = variant;
|
||||
this.config = cfg
|
||||
NamedDomainObjectContainer<AndroidSourceSet> sourceSets = project.extensions.getByType(AppExtension).getSourceSets()
|
||||
File sourceDir = sourceSets.findByName('main')['javaDirectories'][0]
|
||||
|
@ -29,14 +29,15 @@ import org.gradle.api.NamedDomainObjectContainer
|
||||
*/
|
||||
public class PluginBuiltinJsonCreator implements IFileCreator {
|
||||
|
||||
def variant
|
||||
def config
|
||||
File fileDir
|
||||
def fileName
|
||||
def pluginInfos = []
|
||||
|
||||
def PluginBuiltinJsonCreator(def project, def cfg) {
|
||||
config = cfg
|
||||
|
||||
def PluginBuiltinJsonCreator(def project, def variant, def cfg) {
|
||||
this.config = cfg
|
||||
this.variant = variant
|
||||
NamedDomainObjectContainer<AndroidSourceSet> sourceSets = project.extensions.getByType(AppExtension).getSourceSets()
|
||||
fileDir = sourceSets.findByName('main')['assetsDirectories'][0]
|
||||
fileName = config.builtInJsonFileName
|
||||
|
Loading…
Reference in New Issue
Block a user