buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AntDependencyTask.java
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
/*
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     2
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     3
 * All rights reserved.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     4
 * This component and the accompanying materials are made available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     6
 * which accompanies this distribution, and is available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     8
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
     9
 * Initial Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    10
 * Nokia Corporation - initial contribution.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    11
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    12
 * Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    13
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    14
 * Description: 
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    15
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    16
 */
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    17
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
package com.nokia.ant.taskdefs;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    20
import java.io.BufferedReader;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    21
import java.io.BufferedWriter;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    22
import java.io.ByteArrayInputStream;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    23
import java.io.File;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    24
import java.io.FileNotFoundException;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    25
import java.io.FileOutputStream;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    26
import java.io.IOException;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    27
import java.io.InputStreamReader;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    28
import java.io.OutputStreamWriter;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    29
import java.io.UnsupportedEncodingException;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    30
import java.io.Writer;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    31
import java.net.HttpURLConnection;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    32
import java.net.URL;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    33
import java.util.ArrayList;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    34
import java.util.Collections;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    35
import java.util.Enumeration;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    36
import java.util.HashSet;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    37
import java.util.Hashtable;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    38
import java.util.Iterator;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    39
import java.util.List;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    40
import java.util.Map;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    41
import java.util.jar.Attributes;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    42
import java.util.jar.JarFile;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    43
import java.util.jar.Manifest;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    44
import java.util.zip.ZipEntry;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    46
import org.apache.tools.ant.DirectoryScanner;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
import org.apache.tools.ant.Project;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
import org.apache.tools.ant.Task;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
import org.apache.tools.ant.types.FileSet;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    50
import org.dom4j.Document;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    51
import org.dom4j.DocumentException;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    52
import org.dom4j.Element;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
import org.dom4j.io.SAXReader;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
/**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
 * Outputs a directed graph of Ant library dependencies, reads information from dependency jars
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
 */
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    58
public class AntDependencyTask extends Task {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
    private ArrayList<FileSet> antFileSetList = new ArrayList<FileSet>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
    private String outputFile;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    61
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    62
    public AntDependencyTask() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
        setTaskName("AntDependencyTask");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    65
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
     * Add a set of files to copy.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    68
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
     * @param set a set of files to AntDependencyTask.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
     * @ant.required
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
    public void addFileset(FileSet set) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
        antFileSetList.add(set);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    75
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
     * Location of graph file to output to
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    78
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
     * @ant.required
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
     */
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    81
    public void setOutputFile(String path) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
        outputFile = path;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    84
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    85
    public String classToJar(Class aclass) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
        String name = aclass.getName().replace(".", "/") + ".class";
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    87
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    88
        for (Iterator iterator = antFileSetList.iterator(); iterator.hasNext();) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
            FileSet fs = (FileSet) iterator.next();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
            String[] srcFiles = ds.getIncludedFiles();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
            String basedir = ds.getBasedir().getPath();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    93
            // log(basedir);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    94
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    95
            for (int i = 0; i < srcFiles.length; i++) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
                String fileName = basedir + File.separator + srcFiles[i];
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
    97
                // log(fileName);
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
                try {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
                    JarFile jar = new JarFile(fileName);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   100
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   101
                    // for (Enumeration e = jar.entries(); e.hasMoreElements() ;)
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   102
                    // {log(e.nextElement().toString()); }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   103
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   104
                    if (jar.getJarEntry(name) != null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
                        return fileName;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   106
                    }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
                }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   108
                catch (IOException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
                    // We are Ignoring the errors as no need to fail the build.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
                    log(e.getMessage(), Project.MSG_DEBUG);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   113
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   114
        log(name + " not found", Project.MSG_DEBUG);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
        return null;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   117
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   118
    public String getJarAttr(JarFile jar, String nameOfAttr) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
        try {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
            String attr = jar.getManifest().getMainAttributes().getValue(nameOfAttr);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   121
            if (attr != null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   122
                return attr;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   123
            }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   124
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   125
            Manifest manifest = jar.getManifest();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
            Map map = manifest.getEntries();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   127
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   128
            for (Iterator it = map.keySet().iterator(); it.hasNext();) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   129
                String entryName = (String) it.next();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   130
                Attributes attrs = (Attributes) map.get(entryName);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   131
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   132
                for (Iterator it2 = attrs.keySet().iterator(); it2.hasNext();) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   133
                    Attributes.Name attrName = (Attributes.Name) it2.next();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   134
                    if (attrName.toString() == nameOfAttr) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   135
                        return attrs.getValue(attrName).replace("\"", "");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   136
                    }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
            }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   139
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   140
        catch (IOException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   141
            // We are Ignoring the errors as no need to fail the build.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
            log("Not able to get the JAR file attribute information. " + e.getMessage(), Project.MSG_DEBUG);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
        return null;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   146
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   147
    public HashSet<String> getJarInfo() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
        HashSet<String> classlist = new HashSet<String>();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   149
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   150
        for (Iterator iterator = antFileSetList.iterator(); iterator.hasNext();) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
            FileSet fs = (FileSet) iterator.next();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
            String[] srcFiles = ds.getIncludedFiles();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   154
            String basedir = ds.getBasedir().getPath();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   155
            // log(basedir);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   156
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   157
            for (int i = 0; i < srcFiles.length; i++) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   158
                String fileName = basedir + File.separator + srcFiles[i];
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   159
                // log(fileName);
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   160
                try {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
                    JarFile jar = new JarFile(fileName);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   162
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   163
                    String vendor = getJarAttr(jar, "Implementation-Vendor");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   164
                    String version = getJarAttr(jar, "Implementation-Version");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   165
                    if (version == null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
                        version = getJarAttr(jar, "Specification-Version");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   167
                    }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
                    String name = convertJarName(fileName);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   169
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   170
                    // findLicense(srcFiles[i], jar);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   171
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   172
                    String nameandversion = name;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   173
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   174
                    if (version != null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   175
                        version = version.replace("$", "");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   176
                        if (!digitInString(name)) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   177
                            nameandversion = name + " " + version;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   178
                        }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   179
                    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   180
                    if (vendor == null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   181
                        vendor = "";
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   182
                    }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   183
                    classlist.add(name + " [style=filled,shape=record,label=\"" + nameandversion
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   184
                        + "|" + vendor + "\"];");
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   185
                }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   186
                catch (IOException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   187
                    // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   188
                    e.printStackTrace();
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   189
                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   190
            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   191
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   192
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   193
        return classlist;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   194
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   195
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   196
    public void findLicense(String name, JarFile jar) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   197
        try {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   198
            ZipEntry entry = jar.getEntry("META-INF/LICENSE");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   199
            if (entry == null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   200
                entry = jar.getEntry("META-INF/LICENSE.txt");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   201
            }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   202
            if (entry != null) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   203
                /**/
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   204
                log("File in " + name + " in jar file ", Project.MSG_DEBUG);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   205
                byte[] data = new byte[1024];
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   206
                jar.getInputStream(entry).read(data);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   207
                for (String line : new String(data).split("\n")) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   208
                    if (line.contains("License") || line.contains("LICENSE ")
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   209
                        || line.contains("Copyright")) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   210
                        log("Replace License information with * " + line.replace("*", "").trim(), Project.MSG_INFO);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   211
                        break;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   212
                    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   213
                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   214
            }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   215
            else {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   216
                // http://mirrors.ibiblio.org/pub/mirrors/maven2/
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   217
                String mavenUrl = "http://repo2.maven.org/maven2/";
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   218
                Enumeration jarfiles = jar.entries();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   219
                boolean found = false;
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   220
                while (!found && jarfiles.hasMoreElements()) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   221
                    ZipEntry file = (ZipEntry) jarfiles.nextElement();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   222
                    if (file.isDirectory()) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   223
                        String filename = file.getName();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   224
                        String[] split = file.getName().split("/");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   225
                        String end = split[split.length - 1];
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   226
                        String specialfilename = filename + end;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   227
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   228
                        URL url = new URL(mavenUrl + filename + end + "/maven-metadata.xml");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   229
                        if (!end.equals("apache")) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   230
                            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   231
                            if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   232
                                filename = filename.replace(end, name.replace(".jar", ""));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   233
                                end = name.replace(".jar", "");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   234
                                specialfilename = filename;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   235
                                url = new URL(mavenUrl + filename + "maven-metadata.xml");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   236
                                connection = (HttpURLConnection) url.openConnection();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   237
                            }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   238
                            if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   239
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   240
                                SAXReader xmlReader = new SAXReader();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   241
                                Document antDoc = xmlReader.read(url.openStream());
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   242
                                List versions = antDoc.selectNodes("//versioning/versions/version");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   243
                                // if (version.equals(""))
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   244
                                // {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   245
                                // version = antDoc.valueOf("/metadata/version");
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   246
                                // }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   247
                                Collections.reverse(versions);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   248
                                for (Object tmpversion : versions) {
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   249
                                    String version = ((Element) tmpversion).getText();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   250
                                    URL url2 = new URL(mavenUrl + specialfilename + "/" + version
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   251
                                        + "/" + end + "-" + version + ".pom");
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   252
                                    HttpURLConnection connection2 = (HttpURLConnection) url2.openConnection();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   253
                                    if (connection2.getResponseCode() == HttpURLConnection.HTTP_OK) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   254
                                        BufferedReader din = new BufferedReader(new InputStreamReader(url2.openStream()));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   255
                                        StringBuffer sb = new StringBuffer();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   256
                                        String line = null;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   257
                                        while ((line = din.readLine()) != null) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   258
                                            line = line.replace("xmlns=\"http://maven.apache.org/POM/4.0.0\"", "");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   259
                                            sb.append(line + "\n");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   260
                                        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   261
                                        xmlReader = new SAXReader();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   262
                                        //
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   263
                                        Document antDoc2 = xmlReader.read(new ByteArrayInputStream(new String(sb).getBytes()));
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   264
                                        String license = antDoc2.valueOf("/project/licenses/license/name");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   265
                                        if (!license.equals("")) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   266
                                            found = true;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   267
                                            break;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   268
                                        }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   269
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   270
                                    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   271
                                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   272
                            }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   273
                        }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   274
                    }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   275
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   276
                }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   277
                if (!found) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   278
                    log(name + " not found in " + jar, Project.MSG_INFO);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   279
                }
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   280
            }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   281
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   282
        catch (IOException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   283
            // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   284
            e.printStackTrace();
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   285
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   286
        catch (DocumentException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   287
            // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   288
            e.printStackTrace();
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   289
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   290
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   291
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   292
    public boolean digitInString(String s) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   293
        int j = s.length() - 1;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   294
        while (j >= 0 && Character.isDigit(s.charAt(j))) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   295
            return true;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   296
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   297
        return false;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   298
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   299
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   300
    public String convertJarName(String jar) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   301
        return new File(jar).getName().replace(".jar", "").replace("-", "_").replace(".", "_");
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   302
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   303
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   304
    public final void execute() {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   305
        try {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   306
            Project project = getProject();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   307
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   308
            Hashtable taskdefs = project.getTaskDefinitions();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   309
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   310
            HashSet<String> classlist = new HashSet<String>();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   311
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   312
            Enumeration taskdefsenum = taskdefs.keys();
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   313
            while (taskdefsenum.hasMoreElements()) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   314
                String key = (String) taskdefsenum.nextElement();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   315
                Class value = (Class) taskdefs.get(key);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   316
                if (!key.contains("nokia") && !value.toString().contains("org.apache.tools.ant")) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   317
                    String name = value.getPackage().getName();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   318
                    String vendor = value.getPackage().getImplementationVendor();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   319
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   320
                    name = classToJar(value);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   321
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   322
                    if (name != null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   323
                        name = convertJarName(name);
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   324
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   325
                        classlist.add("helium_ant -> \"" + name + "\";");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   326
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   327
                        if (vendor == null) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   328
                            vendor = "";
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   329
                        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   330
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   331
                        classlist.add(name + " [style=filled,shape=record,label=\"" + name + "|"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   332
                            + vendor + "\"];");
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   333
                    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   334
                }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   335
            }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   336
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   337
            classlist.add("helium_ant -> nokia_ant;");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   338
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   339
            classlist.addAll(getJarInfo());
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   340
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   341
            Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF8"));
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   342
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   343
            for (String value : classlist) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   344
                output.write(value + "\n");
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   345
            }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   346
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   347
            output.close();
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   348
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   349
        catch (FileNotFoundException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   350
            // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   351
            log("FileNotFoundException occured while getting the ANT task dependency information. "
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   352
                + e.getMessage(), Project.MSG_DEBUG);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   353
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   354
        catch (UnsupportedEncodingException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   355
            // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   356
            log("UnsupportedEncodingException occured while getting the ANT task dependency information. "
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   357
                + e.getMessage(), Project.MSG_DEBUG);
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   358
        }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   359
        catch (IOException e) {
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   360
            // We are Ignoring the errors as no need to fail the build.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   361
            log("IOException occured while getting the ANT task dependency information. "
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   362
                + e.getMessage(), Project.MSG_DEBUG);
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   363
        }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   364
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   365
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   366
}