示例#1
0
  /**
   * Create a target in a given package.
   *
   * @param pkg The given package.
   * @param name The name of the target.
   */
  public Target(Package pkg, String name) {
    mPackage = pkg;
    mName = name;
    mDependencies = new ArrayList<Dependency>();
    mSources = new ArrayList<Source>();
    mJobs = new ArrayList<Job>();
    mStarter = new Job(this, "Starter").initialize();
    mFinisher = new Job(this, "Finisher").initialize();

    // The Finisher always depends on the Starter.
    mFinisher.dependsOn(mStarter);
  }
示例#2
0
 // Set the target to be dependent on the given dependee.
 private void dependsOn(Target dependee) {
   mStarter.dependsOn(dependee.mFinisher);
 }
示例#3
0
 /**
  * Add an internal job to the target.
  *
  * @param job The job to be added.
  */
 protected void addJob(Job job) {
   mJobs.add(job);
   job.dependsOn(mStarter);
   mFinisher.dependsOn(job);
 }