Esempio n. 1
0
def main():
    if len(sys.argv) < 3:
        print 'Usage: %s <version> <target_for_pom>...' % sys.argv[0]
        sys.exit(1)

    version = sys.argv[1]
    artifacts = maven_artifacts()

    android_sdk_pattern = re.compile(
        r'@androidsdk//([a-z.-]*):([a-z0-9-]*)-([0-9.]*)')

    for label, metadata in METADATA.iteritems():
        artifacts[label] = ('com.google.dagger:%s:%s' %
                            (metadata['artifact'], version))

    def artifact_for_dep(label):
        if label in artifacts:
            return artifacts[label]
        match = android_sdk_pattern.match(label)
        if match:
            return ':'.join(match.groups())
        raise UnknownDependencyException('No artifact found for %s' % label)

    for arg in sys.argv[2:]:
        metadata = METADATA[arg]
        with open('%s.pom.xml' % metadata['artifact'], 'w') as pom_file:
            deps = map(artifact_for_dep, pom_deps(arg))
            deps.sort(cmp=dependencies_comparator)
            pom_file.write(
                generate_pom(artifacts[arg], metadata, deps, version))
Esempio n. 2
0
def main():
  if len(sys.argv) <= 3:
    print 'Usage: %s <version> <target_for_pom>...' % sys.argv[0]
    sys.exit(1)

  version = sys.argv[1]
  artifacts = maven_artifacts()
  artifacts['@androidsdk//com.android.support:support-annotations-24.2.0'] = (
      'com.android.support:support-annotations:24.2.0'
  )

  for label, metadata in METADATA.iteritems():
    artifacts[label] = (
        'com.google.dagger:%s:%s' % (metadata['artifact'], version)
    )
    if 'alias' in metadata:
      artifacts[metadata['alias']] = artifacts[label]

  def artifact_for_dep(label):
    if label in artifacts:
      return artifacts[label]
    raise UnknownDependencyException('No artifact found for %s' % label)

  for arg in sys.argv[2:]:
    metadata = METADATA[arg]
    with open('%s.pom.xml' % metadata['artifact'], 'w') as pom_file:
      pom_file.write(
          generate_pom(
              artifacts[arg],
              metadata,
              map(artifact_for_dep, pom_deps(arg)),
              version))
def main():
  if len(sys.argv) < 3:
    print 'Usage: %s <version> <target_for_pom>...' % sys.argv[0]
    sys.exit(1)

  version = sys.argv[1]
  artifacts = maven_artifacts()

  android_sdk_pattern = re.compile(
      r'@androidsdk//([a-z.-]*):([a-z0-9-]*)-([0-9.]*)')

  for label, metadata in METADATA.iteritems():
    artifacts[label] = (
        'com.google.dagger:%s:%s' % (metadata['artifact'], version)
    )

  def artifact_for_dep(label):
    if label in artifacts:
      return artifacts[label]
    match = android_sdk_pattern.match(label)
    if match:
      return ':'.join(match.groups())
    raise UnknownDependencyException('No artifact found for %s' % label)

  for arg in sys.argv[2:]:
    metadata = METADATA[arg]
    with open('%s.pom.xml' % metadata['artifact'], 'w') as pom_file:
      deps = map(artifact_for_dep, pom_deps(arg))
      deps.sort(cmp=dependencies_comparator)
      pom_file.write(generate_pom(artifacts[arg], metadata, deps, version))
Esempio n. 4
0
def main():
    if len(sys.argv) <= 3:
        print 'Usage: %s <version> <target_for_pom>...' % sys.argv[0]
        sys.exit(1)

    version = sys.argv[1]
    artifacts = maven_artifacts()
    artifacts[
        '@androidsdk//com.android.support:support-annotations-24.2.0'] = (
            'com.android.support:support-annotations:24.2.0')

    for label, metadata in METADATA.iteritems():
        artifacts[label] = ('com.google.dagger:%s:%s' %
                            (metadata['artifact'], version))
        if 'alias' in metadata:
            artifacts[metadata['alias']] = artifacts[label]

    def artifact_for_dep(label):
        if label in artifacts:
            return artifacts[label]
        raise UnknownDependencyException('No artifact found for %s' % label)

    for arg in sys.argv[2:]:
        metadata = METADATA[arg]
        with open('%s.pom.xml' % metadata['artifact'], 'w') as pom_file:
            pom_file.write(
                generate_pom(artifacts[arg], metadata,
                             map(artifact_for_dep, pom_deps(arg)), version))
Esempio n. 5
0
  # Compare each item in the list: first sort by group, then artifact
  if first < second:
    return -1
  else:
    return 1

class UnknownDependencyException(Exception): pass


def main():
  if len(sys.argv) < 3:
    print 'Usage: %s <version> <target_for_pom>...' % sys.argv[0]
    sys.exit(1)

  version = sys.argv[1]
  artifacts = maven_artifacts()

  android_sdk_pattern = re.compile(
      r'@androidsdk//([a-z.-]*):([a-z0-9-]*)-([0-9.]*)')

  for label, metadata in METADATA.iteritems():
    artifacts[label] = (
        'com.google.dagger:%s:%s' % (metadata['artifact'], version)
    )

  def artifact_for_dep(label):
    if label in artifacts:
      return artifacts[label]
    match = android_sdk_pattern.match(label)
    if match:
      return ':'.join(match.groups())