def publishArchivesType = rootProject.ext.config["publishArchivesType"] apply plugin: 'maven' if (publishArchivesType == 1) { uploadArchives { repositories { mavenDeployer { pom.project { groupId "com.didichuxing.doraemonkit" artifactId "dokitx-weex" version rootProject.ext.android["jcenterArchivesVersionName"] } pom.withXml { def node = it.asElement() def nodeList = node.getElementsByTagName('dependency') nodeList.each { dependency -> dependency?.each { config -> if (config?.textContent == 'the-one-sdk') { config.parentNode.parentNode.removeChild(config.parentNode) } if (config?.textContent == 'onecar') { config.parentNode.parentNode.removeChild(config.parentNode) } } } } } } } } else if (publishArchivesType == 0) { def localRepoURL = uri(rootProject.ext.config["localRepoURL"]) uploadArchives { repositories { mavenDeployer { pom.project { groupId "com.didichuxing.doraemonkit" artifactId "dokitx-weex" version rootProject.ext.android["jcenterArchivesVersionName"] } pom.withXml { def node = it.asElement() def nodeList = node.getElementsByTagName('dependency') nodeList.each { dependency -> dependency?.each { config -> if (config?.textContent == 'the-one-sdk') { config.parentNode.parentNode.removeChild(config.parentNode) } if (config?.textContent == 'onecar') { config.parentNode.parentNode.removeChild(config.parentNode) } } } } repository(url: localRepoURL) } } } }