Esempio n. 1
0
def check(f, lines):
    if f.fileType != "xml":
        return None
    dependencies = []
    start = f.fname
    jarFileLines = [line for line in lines if "jar" in line and "destfile" in line]
    assert(len(jarFileLines) == 1)
    jarFileLine = jarFileLines[0]
    target = tools.getString(jarFileLine)
    return Dependency(starts = [start], targets = [target], command = config.runJarCommand + " " + config.targetFilePlaceholder, runInStartFolder = False)
Esempio n. 2
0
def check(f, lines):
    if f.fileType != "xml":
        return None
    dependencies = []
    target = f.fname
    # 
    mainClassLines = [line for line in lines if "Main-Class" in line]
    srcFolderLines = [line for line in lines if "srcdir" in line]
    jarFileLines = [line for line in lines if "jar" in line and "destfile" in line]
    assert(len(mainClassLines) == 1)
    assert(len(srcFolderLines) == 1)
    assert(len(jarFileLines) == 1)
    mainClassLine = mainClassLines[0]
    srcFolderLine = srcFolderLines[0]
    jarFileLine = jarFileLines[0]
    assert("Main-Class" in mainClassLine)
    index = mainClassLine.index("Main-Class") + 11 # look behind the end string of "Main-Class"
    filename = tools.getString(mainClassLine, index)
    srcFolder = tools.getString(srcFolderLine, 0)
    jarFile = tools.getString(jarFileLine)
    start = tools.resolveJavaFilename(srcFolder, filename)
    if start == None:
        return None
    return Dependency(starts = [start], targets = target, command = "ant compile -S -q && ant jar -S -q", runInStartFolder = False)
Esempio n. 3
0
def check(f, lines):
    if f.fileType != "gpi":
        return None
    dependencies = []
    starts = []
    target = f.fname
    for l in lines:
        if "load" in l:
            loadedFile = tools.getString(l)
            if tools.numQuotes(l) > 2 or loadedFile == None: # This occurs with lines like 'load template'.x.'.gpi' which load files dynamically (should happen very rarely). Just ignore it
                continue
            starts.append(loadedFile)
    if len(starts) == 0:
        return None
    return Dependency(starts = starts, targets = target, runInStartFolder = False, printOutput = False)
Esempio n. 4
0
def check(f, lines):
    if f.fileType != "gpi":
        return None
    dependencies = []
    start = f.fname
    targets = []
    for l in lines:
        if "set output" in l:
            outputFile = tools.getString(l)
            if tools.numQuotes(l) > 2 or outputFile == None: # This occurs with lines like 'set output pic'.x.'.gpi' which sets outputfiles dynamically (should happen very rarely). Just ignore it
                continue
            targets.append(outputFile)
    if len(targets) == 0:
        return None
    return Dependency(starts = start, targets = targets, command = "gnuplot %s", printOutput = True)