1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 20 package org.apache.tools.ant.module.spi; 21 22 import java.io.File; 23 24 /** 25 * Permits a module to register special additional JARs (or directories) 26 * to be added to Ant's primary classpath by default. 27 * This should <em>only</em> be used to supply libraries needed by 28 * standard "optional" tasks that ship with Ant - e.g. <code>junit.jar</code> 29 * as needed by the <code><junit></code> task. 30 * Register instances to default lookup. 31 * <p> 32 * Since version <code>org.apache.tools.ant.module/3 3.26</code> there is a 33 * way to register a library declaratively. Just put fragment like this into 34 * your layer file: 35 * <pre> 36 * <filesystem> 37 * <folder name="Services"> 38 * <folder name="Hidden"> 39 * <file name="org-your-lib-ant-registration.instance"> 40 * <attr name="instanceCreate" methodvalue="org.apache.tools.ant.module.spi.AutomaticExtraClasspath.url"/> 41 * <attr name="url" urlvalue="nbinst://org.your.module.name/modules/ext/org-your-lib.jar"/> 42 * <attr name="instanceOf" stringvalue="org.apache.tools.ant.module.spi.AutomaticExtraClasspathProvider"/> 43 * </file> 44 * </folder> 45 * </folder> 46 * </filesystem> 47 * </pre> 48 * 49 * 50 * @since org.apache.tools.ant.module/3 3.8 51 * @author Jesse Glick 52 */ 53 public interface AutomaticExtraClasspathProvider { 54 55 /** 56 * Return a (possibly empty) list of items to add to the 57 * automatic classpath used by default when running Ant. 58 * Note that the result is not permitted to change between calls 59 * in the same VM session. 60 * <p> 61 * The user may be able to override this path, so there is no 62 * firm guarantee that the items will be available when Ant is run. 63 * However by default they will be. 64 * @return zero or more directories or JARs to add to Ant's startup classpath 65 * @see org.openide.modules.InstalledFileLocator 66 */ 67 File[] getClasspathItems(); 68 69 } 70