All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.admc.gradle..Ivyxml.groovy.swp Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
b0VIM 7.2g??N?s5ubisS5UBIS-PCd:/Data/tmp/graivyxml/buildSrc/src/main/groovy/com/admc/gradle/Ivyxml.groovy
3210#"! Utp?A;)Pad??????{Y2?
?
^
/
.
*
???WD	?w)?
?
o
l
!
?	?	?	a	^		??????A????pU8??vH???T)???T
??V??^3????tML    DependencyDescriptor descriptor ->moduleDescriptor.dependencies.each {}        gradleConfig.description = c.description    if (gradleConfig.description == null)    gradleConfig.visible = c.visibility == Visibility.PUBLIC    gradleConfig.transitive = c.transitive        gradleConfig.extendsFrom(gp.configurations.getByName(parentConfName))    for (parentConfName in c.getExtends())    Configuration gradleConfig = gp.configurations.getByName(confName)            moduleDescriptor.getConfiguration(confName)    org.apache.ivy.core.module.descriptor.Configuration c =    if (!gradleProjConfMap.containsKey(confName)) continuefor (def confName in moduleDescriptor.configurationsNames) {    if (e.value.endsWith('/ivy/maven')) { mavenNsPrefix = e.key; break; }for (e in moduleDescriptor.extraAttributesNamespaces)String mavenNsPrefix = null        .parseDescriptor(ivySettings, depFile.toURL(), false)        (DefaultModuleDescriptor) XmlModuleDescriptorParser.instanceDefaultModuleDescriptor moduleDescriptor =    ivySettings.addAllVariables(gp.project.ivyProperties, true)if (gp.project.hasProperty('ivyProperties'))"""set project property 'ivyDepFile' to a File object for your ivy xml file.    """Ivy dep file inaccessible:  $depFile.absolutePathassert depFile.isFile() && depFile.canRead():File depFile = gp.project.hasProperty('ivyDepFile') ? gp.ivyDepFile : gp.file("ivy.xml")}        ivySettings.setVariable('gproj|' + it.key, it.value, true)    if (it.value instanceof String)gp.project.properties.each {ivySettings.defaultInit();IvySettings ivySettings = new IvySettings();for (p in gp.configurations) gradleProjConfMap[p.name] = pdef gradleProjConfMap = [:]//def gradleProjConfMap = configurations.collectEntries { [(it.name): it] }// configurations apparently not a Collection, since this doesn't work:public static void doIvyxml(gp) { */ * @author Blaine Simpson  (blaine dot simpson at admc dot com) * * only dependency settings. * Does not attempt to load any ivysettings files or do any repository setup, * * Set project property ivyProperties, for the obvious purpose. * * This corresponds to Ivy property 'ivy.dep.file'. * you want to use a file other than "ivy.xml" in the project directory. * Set project property ivyDepFile to File of the Ivy dependencies file if * *     User-configurable additional Ivy variables. *     User-configurable ivy dep file (a real File instance). *       (With keys all prefixed with 'gproj|', e.g. use ${gproj|name}). *     Automatically set Ivy variables for every Gradle String-type property. *     Support for 'classifier's specified using a .../ivy/maven' namespace *     Support for 'transitive' settings on confs and/or dependencies *     Support for configuration inheritance via 'extends' *     Code review * The code here includes my own enhancements, including * * issue for GRADLE-197 at http://issues.gradle.org/browse/GRADLE-197 . * This Gradle support for 'ivy.xml' is based on contributed fragments in Jira/**import org.gradle.api.artifacts.Configuration;import org.apache.ivy.core.module.descriptor.Configuration.Visibilityimport org.gradle.api.internal.artifacts.DefaultExcludeRuleimport org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifactimport org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependencyimport org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptorimport org.apache.ivy.core.module.id.ModuleRevisionIdimport org.apache.ivy.core.module.descriptorimport org.apache.ivy.core.settings.Ivyimport org.apache.ivy.core.settingimport org.apache.ivy.core.seimport org.apache.ivy.core.seiimport org.apache.ivy.core.settings.IvySettingspackage com.admc.gradle;ad?
??C???I?
}
=
??e2???xK?
            DependencyDescriptor descriptor ->                             DependencyDescriptor descriptor ->        moduleDescriptor.dependencies.each {        }                gradleConfig.description = c.description            if (gradleConfig.description == null)            gradleConfig.visible = c.visibility == Visibility.PUBLIC            gradleConfig.transitive = c.transitive                gradleConfig.extendsFrom(gp.configurations.getByName(parentConfName))            for (parentConfName in c.getExtends())            Configuration gradleConfig = gp.configurations.getByName(confName)                    moduleDescriptor.getConfiguration(confName)            org.apache.ivy.core.module.descriptor.Configuration c =            if (!gradleProjConfMap.containsKey(confName)) continue        for (def confName in moduleDescriptor.configurationsNames) {            if (e.value.endsWith('/ivy/maven')) { mavenNsPrefix = e.key; break; }        for (e in moduleDescriptor.extraAttributesNamespaces)        String mavenNsPrefix = null                .parseDescriptor(ivySettings, depFile.toURL(), false)                (DefaultModuleDescriptor) XmlModuleDescriptorParser.instance        DefaultModuleDescriptor moduleDescriptor =            ivySettings.addAllVariables(ivyProperties, true)ad??A?x6?`?
?
_
^
Z

???t9??Y?
?
?
Q

?	?	?	?	@	#	 	???????YXH9
??W3????W+???_???V+????lE{    DependencyDescriptor descriptor ->moduleDescriptor.dependencies.each {}        gradleConfig.description = c.description    if (gradleConfig.description == null)    gradleConfig.visible = c.visibility == Visibility.PUBLIC    gradleConfig.transitive = c.transitive        gradleConfig.extendsFrom(gp.configurations.getByName(parentConfName))    for (parentConfName in c.getExtends())    Configuration gradleConfig = gp.configurations.getByName(confName)            moduleDescriptor.getConfiguration(confName)    org.apache.ivy.core.module.descriptor.Configuration c =    if (!gradleProjConfMap.containsKey(confName)) continuefor (def confName in moduleDescriptor.configurationsNames) {    if (e.value.endsWith('/ivy/maven')) { mavenNsPrefix = e.key; break; }for (e in moduleDescriptor.extraAttributesNamespaces)String mavenNsPrefix = null        .parseDescriptor(ivySettings, depFile.toURL(), f        if (        i        if (ivyProperties != null)"""Set plugin property 'ivyxml.depFile' to a File object for your ivy xml file.            """Ivy dep file inaccessible:  $depFile.absolutePath        assert depFile.isFile() && depFile.canRead():        }                ivySettings.setVariable('gproj|' + it.key, it.value, true)            if (it.value instanceof String)        if (variablizeProjStrings) gp.project.properties.each {        ivySettings.defaultInit();        IvySettings ivySettings = new IvySettings();        for (p in gp.configurations) gradleProjConfMap[p.name] = p        def gradleProjConfMap = [:]        //def gradleProjConfMap = configurations.collectEntries { [(it.name): it] }        // configurations apparently not a Collection, since this doesn't work:    void load() {    }        depFile = gp.file('ivy.xml')        gp = p    Ivyxml(p) {    boolean variablizeProjStrings = true    Map ivyProperties    File depFile    private def gpclass Ivyxml { */ * @author Blaine Simpson  (blaine dot simpson at admc dot com) * * only dependency settings. * Does not attempt to load any ivysettings files or do any repository setup, * * Set project property ivyProperties, for the obvious purpose. * * This corresponds to Ivy property 'ivy.dep.file'. * you want to use a file other than "ivy.xml" in the project directory. * Set project property ivyDepFile to File of the Ivy dependencies file if * *     User-configurable additional Ivy variables. *     User-configurable ivy dep file (a real File instance). *       (With keys all prefixed with 'gproj|', e.g. use ${gproj|name}). *     Automatically set Ivy variables for every Gradle String-type property. *     Support for 'classifier's specified using a .../ivy/maven' namespace *     Support for 'transitive' settings on confs and/or dependencies *     Support for configuration inheritance via 'extends' *     Code review * The code here includes my own enhancements, including * * issue for GRADLE-197 at http://issues.gradle.org/browse/GRADLE-197 . * This Gradle support for 'ivy.xml' is based on contributed fragments in Jira/**import org.gradle.api.artifacts.Configuration;import org.apache.ivy.core.module.descriptor.Configuration.Visibilityimport org.gradle.api.internal.artifacts.DefaultExcludeRuleimport org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifactimport org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependencyimport org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptorimport org.apache.ivy.core.module.id.ModuleRevisionIdimport org.apache.ivy.core.module.descriptor.DependencyDescriptorimport org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParserimport org.apache.ivy.core.module.descriptor.DefaultModuleDescriptorad4?)?xf,???c7?
?
?
c
+
!
??bX???j/?
?
}
|
D

?	?	m	[		????????P??2???                                          */d*/*/displayDeps.descrip*/displayDeps.description = '''Lists Ivy dep*/displayDeps.description = '''Lis*/displayDeps.description = '''Lists Ivy deps only for specified 'config.name'*/displayDeps.description = '''Lists Ivy deps only for specified 'config.n*/displayDeps.description = '''Lists Ivy deps only for specified 'conf*/displayDeps.description = '''Lists Ivy deps only for speci*/displayDeps.description = '''Lists Ivy deps only for specified 'co*/*/displayDeps.description = '''Lists Ivy deps only for specified 'config.name'.'*/}    }        }            }                gradleProjConfMap[mappableConfName].getDependencies().add(dep)                }                    }                        excRuleContainer.add(new DefaultExcludeRule(it.attributes))                    def ruleList -> ruleList.each {                descriptor.excludeRules?.values().each {                def excRuleContainer = dep.excludeRules                }                                depArt.name, depArt.type, depArt.ext, null, depArt.url))                        dep.addArtifact(new DefaultDependencyArtifact(                    DependencyArtifactDescriptor depArt ->                descriptor.allDependencyArtifacts.each {                dep.transitive = descriptor.transitive                dep.changing = descriptor.changing                gp.dependencies { dep = add(mappableConfName, depAttrs) }        }        println "CLASSIFIER=$depAttrs.classifier"                            mavenNsPrefix + ':classifier']                    depAttrs['classifier'] = descriptor.qualifiedExtraAttributes[        {                        mavenNsPrefix + ':classifier'))                        && descriptor.qualifiedExtraAttributes.containsKey(                if (mavenNsPrefix != null                ]                    version: id.revision                    name: id.name,                    group: id.organisation,                def depAttrs = [                DefaultExternalModuleDependency dep                ModuleRevisionId id = descriptor.dependencyRevisionId                if (!mappableConfName) return            for (mappableConfName in mappableConfNames) {                }                    gradleProjConfMap.containsKey(it)                def mappableConfNames = descriptor.moduleConfigurations.findAll {




© 2015 - 2024 Weber Informatics LLC | Privacy Policy