aQute.bnd.osgi.Builder.trace()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(13.4k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中aQute.bnd.osgi.Builder.trace()方法的一些代码示例,展示了Builder.trace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Builder.trace()方法的具体详情如下:
包路径:aQute.bnd.osgi.Builder
类名称:Builder
方法名:trace

Builder.trace介绍

暂无

代码示例

代码示例来源:origin: biz.aQute/bndlib

public Resource process(String source) {
  Map<Instruction,Map<String,String>> make = getMakeHeader();
  builder.trace("make " + source);
  for (Map.Entry<Instruction,Map<String,String>> entry : make.entrySet()) {
    Instruction instr = entry.getKey();
    Matcher m = instr.getMatcher(source);
    if (m.matches() || instr.isNegated()) {
      Map<String,String> arguments = replace(m, entry.getValue());
      List<MakePlugin> plugins = builder.getPlugins(MakePlugin.class);
      for (MakePlugin plugin : plugins) {
        try {
          Resource resource = plugin.make(builder, source, arguments);
          if (resource != null) {
            builder.trace("Made " + source + " from args " + arguments + " with " + plugin);
            return resource;
          }
        }
        catch (Exception e) {
          builder.error("Plugin " + plugin + " generates error when use in making " + source
              + " with args " + arguments, e);
        }
      }
    }
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public Resource process(String source) {
  Map<Instruction,Map<String,String>> make = getMakeHeader();
  builder.trace("make " + source);
  for (Map.Entry<Instruction,Map<String,String>> entry : make.entrySet()) {
    Instruction instr = entry.getKey();
    Matcher m = instr.getMatcher(source);
    if (m.matches() || instr.isNegated()) {
      Map<String,String> arguments = replace(m, entry.getValue());
      List<MakePlugin> plugins = builder.getPlugins(MakePlugin.class);
      for (MakePlugin plugin : plugins) {
        try {
          Resource resource = plugin.make(builder, source, arguments);
          if (resource != null) {
            builder.trace("Made " + source + " from args " + arguments + " with " + plugin);
            return resource;
          }
        }
        catch (Exception e) {
          builder.error("Plugin " + plugin + " generates error when use in making " + source
              + " with args " + arguments, e);
        }
      }
    }
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bnd

public Resource process(String source) {
  Map<Instruction,Map<String,String>> make = getMakeHeader();
  builder.trace("make " + source);
  for (Map.Entry<Instruction,Map<String,String>> entry : make.entrySet()) {
    Instruction instr = entry.getKey();
    Matcher m = instr.getMatcher(source);
    if (m.matches() || instr.isNegated()) {
      Map<String,String> arguments = replace(m, entry.getValue());
      List<MakePlugin> plugins = builder.getPlugins(MakePlugin.class);
      for (MakePlugin plugin : plugins) {
        try {
          Resource resource = plugin.make(builder, source, arguments);
          if (resource != null) {
            builder.trace("Made " + source + " from args " + arguments + " with " + plugin);
            return resource;
          }
        }
        catch (Exception e) {
          builder.error("Plugin " + plugin + " generates error when use in making " + source
              + " with args " + arguments, e);
        }
      }
    }
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

@Override
public void write(OutputStream out) throws IOException, Exception {
  StringBuilder errors = new StringBuilder();
  StringBuilder stdout = new StringBuilder();
  domain.trace("executing command %s", command);
  Command cmd = new Command("sh");
  cmd.setCwd(wd);
  cmd.inherit();
  String oldpath = cmd.var("PATH");
  String path = domain.getProperty("-PATH");
  if (path != null) {
    path = path.replaceAll("\\s*,\\s*", File.pathSeparator);
    path = path.replaceAll("\\$\\{@\\}", oldpath);
    cmd.var("PATH", path);
    domain.trace("PATH: %s", path);
  }
  OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");
  int result = cmd.execute(command, stdout, errors);
  osw.append(stdout);
  osw.flush();
  if (result != 0) {
    domain.error("Cmd '%s' failed in %s. %n  %s%n  %s", command, wd, errors, stdout);
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

@Override
public void write(OutputStream out) throws IOException, Exception {
  StringBuilder errors = new StringBuilder();
  StringBuilder stdout = new StringBuilder();
  domain.trace("executing command %s", command);
  Command cmd = new Command("sh");
  cmd.setCwd(wd);
  cmd.inherit();
  String oldpath = cmd.var("PATH");
  String path = domain.getProperty("-PATH");
  if (path != null) {
    path = path.replaceAll("\\s*,\\s*", File.pathSeparator);
    path = path.replaceAll("\\$\\{@\\}", oldpath);
    cmd.var("PATH", path);
    domain.trace("PATH: %s", path);
  }
  OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");
  int result = cmd.execute(command, stdout, errors);
  osw.append(stdout);
  osw.flush();
  if (result != 0) {
    domain.error("Cmd '%s' failed in %s. %n  %s%n  %s", command, wd, errors, stdout);
  }
}

代码示例来源:origin: biz.aQute/bndlib

@Override
public void write(OutputStream out) throws IOException, Exception {
  StringBuilder errors = new StringBuilder();
  StringBuilder stdout = new StringBuilder();
  try {
    domain.trace("executing command %s", command);
    Command cmd = new Command("sh");
    cmd.setCwd(wd);
    cmd.inherit();
    String oldpath = cmd.var("PATH");
    String path = domain.getProperty("-PATH");
    if (path != null) {
      path = path.replaceAll("\\s*,\\s*", File.pathSeparator);
      path = path.replaceAll("\\$\\{@\\}", oldpath);
      cmd.var("PATH", path);
      domain.trace("PATH: %s", path);
    }
    OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");
    int result = cmd.execute(command, stdout, errors);
    osw.append(stdout);
    osw.flush();
    if (result != 0) {
      domain.error("executing command failed %s %s", command, stdout + "\n" + errors);
    }
  }
  catch (Exception e) {
    domain.error("executing command failed %s %s", command, e.getMessage());
  }
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Cop
 * 
 * @param dest
 * @param srce
 * @param path
 * @param overwriteResource
 */
private void copy(Jar dest, Jar srce, String path, boolean overwrite) {
  trace("copy d=" + dest + " s=" + srce +" p="+ path);
  dest.copy(srce, path, overwrite);
  
  // bnd.info sources must be preprocessed
  String bndInfoPath = path + "/bnd.info";
  Resource r = dest.getResource(bndInfoPath);
  if ( r != null && !(r instanceof PreprocessResource)) {
    trace("preprocessing bnd.info");
    PreprocessResource pp = new PreprocessResource(this, r);
    dest.putResource(bndInfoPath, pp);
  }
  
  if (hasSources()) {
    String srcPath = "OSGI-OPT/src/" + path;
    Map<String,Resource> srcContents = srce.getDirectories().get(srcPath);
    if (srcContents != null) {
      dest.addDirectory(srcContents, overwrite);
    }
  }
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Check if we need to calculate any checksums.
 * 
 * @param dot
 * @throws Exception
 */
private void doDigests(Jar dot) throws Exception {
  Parameters ps = OSGiHeader.parseHeader(getProperty(DIGESTS));
  if (ps.isEmpty())
    return;
  trace("digests %s", ps);
  String[] digests = ps.keySet().toArray(new String[ps.size()]);
  dot.setDigestAlgorithms(digests);
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Check if we need to calculate any checksums.
 *
 * @param dot
 * @throws Exception
 */
private void doDigests(Jar dot) throws Exception {
  Parameters ps = OSGiHeader.parseHeader(getProperty(DIGESTS));
  if (ps.isEmpty())
    return;
  trace("digests %s", ps);
  String[] digests = ps.keySet().toArray(new String[ps.size()]);
  dot.setDigestAlgorithms(digests);
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Cop
 *
 * @param dest
 * @param srce
 * @param path
 * @param overwriteResource
 */
private void copy(Jar dest, Jar srce, String path, boolean overwrite) {
  trace("copy d=" + dest + " s=" + srce + " p=" + path);
  dest.copy(srce, path, overwrite);
  // bnd.info sources must be preprocessed
  String bndInfoPath = path + "/bnd.info";
  Resource r = dest.getResource(bndInfoPath);
  if (r != null && !(r instanceof PreprocessResource)) {
    trace("preprocessing bnd.info");
    PreprocessResource pp = new PreprocessResource(this, r);
    dest.putResource(bndInfoPath, pp);
  }
  if (hasSources()) {
    String srcPath = "OSGI-OPT/src/" + path;
    Map<String,Resource> srcContents = srce.getDirectories().get(srcPath);
    if (srcContents != null) {
      dest.addDirectory(srcContents, overwrite);
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Cop
 *
 * @param dest
 * @param srce
 * @param path
 * @param overwriteResource
 */
private void copy(Jar dest, Jar srce, String path, boolean overwrite) {
  trace("copy d=" + dest + " s=" + srce + " p=" + path);
  dest.copy(srce, path, overwrite);
  // bnd.info sources must be preprocessed
  String bndInfoPath = path + "/bnd.info";
  Resource r = dest.getResource(bndInfoPath);
  if (r != null && !(r instanceof PreprocessResource)) {
    trace("preprocessing bnd.info");
    PreprocessResource pp = new PreprocessResource(this, r);
    dest.putResource(bndInfoPath, pp);
  }
  if (hasSources()) {
    String srcPath = "OSGI-OPT/src/" + path;
    Map<String,Resource> srcContents = srce.getDirectories().get(srcPath);
    if (srcContents != null) {
      dest.addDirectory(srcContents, overwrite);
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Check if we need to calculate any checksums.
 *
 * @param dot
 * @throws Exception
 */
private void doDigests(Jar dot) throws Exception {
  Parameters ps = OSGiHeader.parseHeader(getProperty(DIGESTS));
  if (ps.isEmpty())
    return;
  trace("digests %s", ps);
  String[] digests = ps.keySet().toArray(new String[ps.size()]);
  dot.setDigestAlgorithms(digests);
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Turn this normal bundle in a web and add any resources.
 * 
 * @throws Exception
 */
private Jar doWab(Jar dot) throws Exception {
  String wab = getProperty(WAB);
  String wablib = getProperty(WABLIB);
  if (wab == null && wablib == null)
    return dot;
  trace("wab %s %s", wab, wablib);
  setBundleClasspath(append("WEB-INF/classes", getProperty(BUNDLE_CLASSPATH)));
  Set<String> paths = new HashSet<String>(dot.getResources().keySet());
  for (String path : paths) {
    if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
      trace("wab: moving: %s", path);
      dot.rename(path, "WEB-INF/classes/" + path);
    }
  }
  Parameters clauses = parseHeader(getProperty(WABLIB));
  for (String key : clauses.keySet()) {
    File f = getFile(key);
    addWabLib(dot, f);
  }
  doIncludeResource(dot, wab);
  return dot;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Turn this normal bundle in a web and add any resources.
 *
 * @throws Exception
 */
private Jar doWab(Jar dot) throws Exception {
  String wab = getProperty(WAB);
  String wablib = getProperty(WABLIB);
  if (wab == null && wablib == null)
    return dot;
  trace("wab %s %s", wab, wablib);
  setBundleClasspath(append("WEB-INF/classes", getProperty(BUNDLE_CLASSPATH)));
  Set<String> paths = new HashSet<String>(dot.getResources().keySet());
  for (String path : paths) {
    if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
      trace("wab: moving: %s", path);
      dot.rename(path, "WEB-INF/classes/" + path);
    }
  }
  Parameters clauses = parseHeader(getProperty(WABLIB));
  for (String key : clauses.keySet()) {
    File f = getFile(key);
    addWabLib(dot, f);
  }
  doIncludeResource(dot, wab);
  return dot;
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Turn this normal bundle in a web and add any resources.
 *
 * @throws Exception
 */
private Jar doWab(Jar dot) throws Exception {
  String wab = getProperty(WAB);
  String wablib = getProperty(WABLIB);
  if (wab == null && wablib == null)
    return dot;
  trace("wab %s %s", wab, wablib);
  setBundleClasspath(append("WEB-INF/classes", getProperty(BUNDLE_CLASSPATH)));
  Set<String> paths = new HashSet<String>(dot.getResources().keySet());
  for (String path : paths) {
    if (path.indexOf('/') > 0 && !Character.isUpperCase(path.charAt(0))) {
      trace("wab: moving: %s", path);
      dot.rename(path, "WEB-INF/classes/" + path);
    }
  }
  Parameters clauses = parseHeader(getProperty(WABLIB));
  for (String key : clauses.keySet()) {
    File f = getFile(key);
    addWabLib(dot, f);
  }
  doIncludeResource(dot, wab);
  return dot;
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 * 
 * @return
 */
void sign(@SuppressWarnings("unused") Jar jar) throws Exception {
  String signing = getProperty("-sign");
  if (signing == null)
    return;
  trace("Signing %s, with %s", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String,Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 *
 * @return
 */
void sign(@SuppressWarnings("unused")
Jar jar) throws Exception {
  String signing = getProperty(SIGN);
  if (signing == null)
    return;
  trace("Signing %s, with %s", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String,Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Sign the jar file. -sign : <alias> [ ';' 'password:=' <password> ] [ ';'
 * 'keystore:=' <keystore> ] [ ';' 'sign-password:=' <pw> ] ( ',' ... )*
 *
 * @return
 */
void sign(@SuppressWarnings("unused")
Jar jar) throws Exception {
  String signing = getProperty(SIGN);
  if (signing == null)
    return;
  trace("Signing %s, with %s", getBsn(), signing);
  List<SignerPlugin> signers = getPlugins(SignerPlugin.class);
  Parameters infos = parseHeader(signing);
  for (Entry<String,Attrs> entry : infos.entrySet()) {
    for (SignerPlugin signer : signers) {
      signer.sign(this, entry.getKey());
    }
  }
}

代码示例来源:origin: biz.aQute/bndlib

if (conditionals.isEmpty())
  return null;
trace("do Conditional Package %s", conditionals);
Instructions instructions = new Instructions(conditionals);
  trace("extra dirs %s", jar.getDirectories());
  return null;

代码示例来源:origin: biz.aQute.bnd/bndlib

if (conditionals.isEmpty())
  return null;
trace("do Conditional Package %s", conditionals);
Instructions instructions = new Instructions(conditionals);
  trace("extra dirs %s", jar.getDirectories());
  return null;

相关文章

微信公众号

最新文章

更多

Builder类方法