Browse Source

Proven to be useful to pick up just one feature of BigProjectLogger without all the chrome.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@928005 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 15 years ago
parent
commit
3078886d89
3 changed files with 50 additions and 18 deletions
  1. +3
    -0
      WHATSNEW
  2. +1
    -18
      src/main/org/apache/tools/ant/listener/BigProjectLogger.java
  3. +46
    -0
      src/main/org/apache/tools/ant/listener/SimpleBigProjectLogger.java

+ 3
- 0
WHATSNEW View File

@@ -116,6 +116,9 @@ Other changes:
1.7.1. 1.7.1.
Bugzilla Report 48734. Bugzilla Report 48734.


* Added SimpleBigProjectLogger, intermediate between NoBannerLogger and
BigProjectLogger.

Changes from Ant 1.8.0RC1 TO Ant 1.8.0 Changes from Ant 1.8.0RC1 TO Ant 1.8.0
====================================== ======================================




+ 1
- 18
src/main/org/apache/tools/ant/listener/BigProjectLogger.java View File

@@ -18,7 +18,6 @@
package org.apache.tools.ant.listener; package org.apache.tools.ant.listener;


import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.NoBannerLogger;
import org.apache.tools.ant.SubBuildListener; import org.apache.tools.ant.SubBuildListener;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.StringUtils; import org.apache.tools.ant.util.StringUtils;
@@ -33,7 +32,7 @@ import java.io.File;
* @since Ant1.7.1 * @since Ant1.7.1
*/ */


public class BigProjectLogger extends NoBannerLogger
public class BigProjectLogger extends SimpleBigProjectLogger
implements SubBuildListener { implements SubBuildListener {


private volatile boolean subBuildStartedRaised = false; private volatile boolean subBuildStartedRaised = false;
@@ -114,22 +113,6 @@ public class BigProjectLogger extends NoBannerLogger
super.messageLogged(event); super.messageLogged(event);
} }


/**
* Override point, extract the target name
*
* @param event the event to work on
* @return the target name -including the owning project name (if non-null)
*/
protected String extractTargetName(BuildEvent event) {
String targetName = event.getTarget().getName();
String projectName = extractProjectName(event);
if (projectName != null && targetName != null) {
return projectName + '.' + targetName;
} else {
return targetName;
}
}



/** /**
* {@inheritDoc} * {@inheritDoc}


+ 46
- 0
src/main/org/apache/tools/ant/listener/SimpleBigProjectLogger.java View File

@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.listener;

import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.NoBannerLogger;

/**
* Displays subproject names like {@link BigProjectLogger}
* but is otherwise as quiet as {@link NoBannerLogger}.
* @since Ant1.8.1
*/
public class SimpleBigProjectLogger extends NoBannerLogger {

/**
* Override point, extract the target name
*
* @param event the event to work on
* @return the target name -including the owning project name (if non-null)
*/
protected String extractTargetName(BuildEvent event) {
String targetName = super.extractTargetName(event);
String projectName = extractProjectName(event);
if (projectName != null && targetName != null) {
return projectName + '.' + targetName;
} else {
return targetName;
}
}

}

Loading…
Cancel
Save