@@ -0,0 +1,2593 @@
+package org.codehaus.mojo.natives.bcc;%0A%0A/*%0A * The MIT License%0A *%0A * Copyright (c) 2004, The Codehaus%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy of%0A * this software and associated documentation files (the %22Software%22), to deal in%0A * the Software without restriction, including without limitation the rights to%0A * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies%0A * of the Software, and to permit persons to whom the Software is furnished to do%0A * so, subject to the following conditions:%0A * %0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A * %0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A*/%0A%0Aimport java.io.File;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.codehaus.mojo.natives.EnvFactory;%0Aimport org.codehaus.mojo.natives.NativeBuildException;%0Aimport org.codehaus.mojo.natives.util.EnvUtil;%0A%0A/**%0A * BCC Environment Setup%0A * @author dtran%0A *%0A */%0A%0Apublic class BCCEnvFactory %0A    implements EnvFactory %0A%7B%0A%09private static final String BCC_INSTALL_ENV_KEY = %22BCC_INSTALL_DIR%22;%0A%09private static final String DEFAULT_BCC_INSTALL_DIR= %22C:/Borland/BCC%22 ;%0A%09%0A    %0A    private static Map envs;%0A    %0A    public synchronized Map getEnvironmentVariables() %0A        throws NativeBuildException%0A    %7B%0A        if ( envs == null )%0A        %7B%0A            envs = createEnvs();%0A        %7D%0A        %0A        return envs;%0A    %7D%0A    %0A     %0A    private Map createEnvs()%0A      throws NativeBuildException%0A%09%7B%0A%09%09File bccDir = new File ( EnvUtil.getEnv( BCC_INSTALL_ENV_KEY, DEFAULT_BCC_INSTALL_DIR ) );%0A%09%09%0A%09%09if ( ! bccDir.isDirectory() )%0A%09%09%7B%0A%09%09%09throw new NativeBuildException( bccDir.getPath() + %22 is not a directory.%22 );%0A%09%09%7D%0A%09%09%0A        Map envs = new HashMap();%0A        %0A        if ( bccDir == null )%0A        %7B%0A            return envs;%0A        %7D%0A        %0A        //setup new PATH%0A        String currentPath = EnvUtil.getEnv ( %22PATH%22 );%0A        %0A        String newPath = bccDir.getPath()+%22%5C%5CBIN;%22 + %0A                         currentPath; %0A%0A        envs.put( %22PATH%22, newPath );%0A%0A        %0A        return envs;%0A%09%09%0A%09%7D%0A%0A%7D%0A

Add BCCEnvFactory