Exemple #1
0
    def _create_template_data(self):
        jar_dependency, id, exported = self._get_artifact_info()

        if self.excludes:
            exclude_template_datas = [
                exclude._create_template_data() for exclude in self.excludes
            ]
        else:
            exclude_template_datas = None

        return TemplateData(
            id=id,
            name=self.name,
            template_base=self.target_base,
            exported=exported,
            org=jar_dependency.org,
            module=jar_dependency.name,
            version=jar_dependency.rev,
            sources=self.sources,
            java_sources=resolve_target_sources(self.java_sources, '.java'),
            dependencies=[
                dep._create_template_data() for dep in self.jar_dependencies
            ],
            excludes=exclude_template_datas,
            buildflags=self.buildflags,
        )
Exemple #2
0
 def calculate_sources(target):
     sources = []
     srcs = [os.path.join(target.target_base, src) for src in target.sources if src.endswith(".scala")]
     sources.extend(srcs)
     if (isinstance(target, ScalaLibrary) or isinstance(target, ScalaTests)) and target.java_sources:
         sources.extend(resolve_target_sources(target.java_sources, ".java"))
     return sources
Exemple #3
0
        def collect_sources(target):
            src = (os.path.join(target.target_base, source) for source in target.sources if source.endswith(".scala"))
            if src:
                bases.add(target.target_base)
                sources[target].update(src)

                if (isinstance(target, ScalaLibrary) or isinstance(target, ScalaTests)) and (target.java_sources):
                    sources[target].update(resolve_target_sources(target.java_sources, ".java"))
Exemple #4
0
 def _calculate_sources(target):
   """Find a target's source files."""
   sources = []
   srcs = \
     [os.path.join(target.target_base, src) for src in target.sources if src.endswith('.scala')]
   sources.extend(srcs)
   if (isinstance(target, ScalaLibrary) or isinstance(target, ScalaTests)) and target.java_sources:
     sources.extend(resolve_target_sources(target.java_sources, '.java'))
   return sources
Exemple #5
0
    def collect_sources(target):
      src = (os.path.join(target.target_base, source)
             for source in target.sources if source.endswith('.scala'))
      if src:
        sources[target].update(src)

        if (isinstance(target, ScalaLibrary) or isinstance(target, ScalaTests)) and (
            target.java_sources):
          sources[target].update(resolve_target_sources(target.java_sources, '.java'))
Exemple #6
0
 def calculate_sources(target):
     sources = []
     srcs = \
       [os.path.join(target.target_base, src) for src in target.sources if src.endswith('.scala')]
     sources.extend(srcs)
     if (isinstance(target, ScalaLibrary)
             or isinstance(target, ScalaTests)) and target.java_sources:
         sources.extend(
             resolve_target_sources(target.java_sources, '.java'))
     return sources
Exemple #7
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(self.target_base, source) for source in self.sources)
    if self.resources:
      allsources += list(os.path.join(self.sibling_resources_base, res) for res in self.resources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      java_sources = resolve_target_sources(self.java_sources, '.java'),
      resources = self.resources,
      deploy_jar = self.deployjar,
      allsources = allsources,
    )
Exemple #8
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(self.target_base, source) for source in self.sources)
    if self.resources:
      allsources += list(os.path.join(self.sibling_resources_base, res) for res in self.resources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      java_sources = resolve_target_sources(self.java_sources, '.java'),
      resources = self.resources,
      deploy_jar = self.deployjar,
      allsources = allsources,
    )
Exemple #9
0
  def _create_template_data(self):
    jar_dependency, id, exported = self._get_artifact_info()

    if self.excludes:
      exclude_template_datas = [exclude._create_template_data() for exclude in self.excludes]
    else:
      exclude_template_datas = None

    return TemplateData(
      id = id,
      name = self.name,
      template_base = self.target_base,
      exported = exported,
      org = jar_dependency.org,
      module = jar_dependency.name,
      version = jar_dependency.rev,
      sources = self.sources,
      java_sources = resolve_target_sources(self.java_sources, '.java'),
      dependencies = [dep._create_template_data() for dep in self.jar_dependencies],
      excludes = exclude_template_datas,
      buildflags = self.buildflags,
    )
Exemple #10
0
 def calculate_sources(target):
   sources = [s for s in target.sources_relative_to_buildroot() if s.endswith(self._file_suffix)]
   # TODO: Make this less hacky. Ideally target.java_sources will point to sources, not targets.
   if hasattr(target, 'java_sources') and target.java_sources:
     sources.extend(resolve_target_sources(target.java_sources, '.java'))
   return sources