Skip to content

Commit

Permalink
不再为每个micromodule生成各自的R类
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchengdong committed Jul 4, 2019
1 parent 99ef8bc commit 9b4eaa9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class MicroModulePlugin implements Plugin<Project> {

private final static String APPLY_NORMAL_MICRO_MODULE_SCRIPT = 'apply_normal_micro_module_script'
private final static String APPLY_INCLUDE_MICRO_MODULE_SCRIPT = 'apply_include_micro_module_script'
private final static String APPLY_UPLOAD_MICRO_MODULE_SCRIPT = 'apply_upload_micro_module_script'
private final static String APPLY_EXPORT_MICRO_MODULE_SCRIPT = 'apply_export_micro_module_script'

private final static BuildListener buildListener = new BuildListener() {
Expand Down Expand Up @@ -114,8 +113,7 @@ class MicroModulePlugin implements Plugin<Project> {
if (applyScriptState == APPLY_INCLUDE_MICRO_MODULE_SCRIPT) {
configuration.dependencies.remove(it)
return
} else if (applyScriptState == APPLY_UPLOAD_MICRO_MODULE_SCRIPT
|| applyScriptState == APPLY_NORMAL_MICRO_MODULE_SCRIPT
} else if (applyScriptState == APPLY_NORMAL_MICRO_MODULE_SCRIPT
|| applyScriptState == APPLY_EXPORT_MICRO_MODULE_SCRIPT) {
return
} else if (currentMicroModule == null && startTaskState == ASSEMBLE_OR_GENERATE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,43 +306,6 @@ class CodeChecker {
return checkManifest.save(manifest)
}

private void handleMicroModuleRAndBuildConfig(String microModuleName, String name, String find, List<String> textLines, String absolutePath) {
String packageName = name.substring(0, name.lastIndexOf('.'))
List<String> microModules = microModulePackageNameMap.get(packageName)
if (microModules == null || microModules.contains(name)) return

boolean hasDependency
List<String> withoutDependency = new ArrayList<>()
for (String from : microModules) {
hasDependency = microModuleInfo.hasDependency(microModuleName, from)
if (hasDependency) {
break
}
withoutDependency.add(from)
}

if (hasDependency) {
return
}

List<Number> lines = textLines.findIndexValues { it.contains(find) }
lines.each {
def lineIndex = it.intValue()
def lineContext = textLines.get(lineIndex).trim()
if (lineContext.startsWith("//") || lineContext.startsWith("/*")) {
return
}

def message = absolutePath + ':' + (lineIndex + 1)
if (!errorMessage.contains(message)) {
message += lineSeparator
message += "- cannot use [" + find + "] which from MicroModule '${withoutDependency.get(0)}'."
message += lineSeparator
errorMessage += message
}
}
}

private String initMicroModulePackageName() {
microModulePackageNameMap = new HashMap<>()
microModuleInfo.includeMicroModules.each {
Expand Down

0 comments on commit 9b4eaa9

Please sign in to comment.