/*
 * Copyright
 *   2007 axYus - www.axyus.com
 *   2007 C.Marchand - christophe.marchand@axyus.com
 *
 * This file is part of XEMELIOS.
 *
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * XEMELIOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package fr.gouv.finances.cp.buildtools;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

/**
 *
 * @author chm
 */
public class MakeComponentsFile {
    
    /** Creates a new instance of MakeComponentsFile */
    public static void main(String[] args) {
        System.out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
        System.out.println("<xemelios-components>");
        for(String s:args) {
            Properties props = new Properties();
            File f = new File(System.getProperty("user.dir"));
            f = new File(f,s);
            f = new File(f,"component.properties");
            try {
                props.load(new FileInputStream(f));
                System.out.println("\t<component description=\""+props.getProperty("component.description")+"\" id=\""+props.getProperty("component.name")+"\" version=\""+props.getProperty("component.release")+"\"/>");
            } catch(Throwable t) {}
        }
        System.out.println("\t<component description=\"Ancienne de couche de persistence MySql (pour compatibilite)\" id=\"MySql-persistence\" version=\"3.3.0.0\"/>");
        System.out.println("</xemelios-components>");
    }
    
}
