Java Code Examples for org.gradle.internal.os.OperatingSystem#isWindows()

The following examples show how to use org.gradle.internal.os.OperatingSystem#isWindows() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GccToolSearchPath.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected File findExecutable(OperatingSystem operatingSystem, String name) {
    List<String> candidates;
    if (operatingSystem.isWindows()) {
        // Under Cygwin, g++/gcc is a Cygwin symlink to either g++-3 or g++-4. We can't run g++ directly
        candidates = Arrays.asList(name + "-4", name + "-3", name);
    } else {
        candidates = Arrays.asList(name);
    }
    for (String candidate : candidates) {
        File executable = super.findExecutable(operatingSystem, candidate);
        if (executable != null) {
            return executable;
        }
    }
    return null;
}
 
Example 2
Source File: GccToolSearchPath.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected File findExecutable(OperatingSystem operatingSystem, String name) {
    List<String> candidates;
    if (operatingSystem.isWindows()) {
        // Under Cygwin, g++/gcc is a Cygwin symlink to either g++-3 or g++-4. We can't run g++ directly
        candidates = Arrays.asList(name + "-4", name + "-3", name);
    } else {
        candidates = Arrays.asList(name);
    }
    for (String candidate : candidates) {
        File executable = super.findExecutable(operatingSystem, candidate);
        if (executable != null) {
            return executable;
        }
    }
    return null;
}
 
Example 3
Source File: DefaultGradleDistribution.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public boolean worksWith(OperatingSystem os) {
    // 1.0-milestone-5 was broken where jna was not available
    //noinspection SimplifiableIfStatement
    if (isVersion("1.0-milestone-5")) {
        return os.isWindows() || os.isMacOsX() || os.isLinux();
    } else {
        return true;
    }
}
 
Example 4
Source File: ToolSearchPath.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private File maybeResolveFile(OperatingSystem operatingSystem, File symlinkCandidate, File exeCandidate) throws IOException {
    if (exeCandidate.isFile()) {
        return exeCandidate;
    }
    if (operatingSystem.isWindows()) {
        File symlink = maybeResolveCygwinSymlink(symlinkCandidate);
        if (symlink != null) {
            return symlink;
        }
    }
    return null;
}
 
Example 5
Source File: DefaultGradleDistribution.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public boolean worksWith(OperatingSystem os) {
    // 1.0-milestone-5 was broken where jna was not available
    //noinspection SimplifiableIfStatement
    if (isVersion("1.0-milestone-5")) {
        return os.isWindows() || os.isMacOsX() || os.isLinux();
    } else {
        return true;
    }
}
 
Example 6
Source File: DefaultGradleDistribution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public boolean worksWith(OperatingSystem os) {
    // 1.0-milestone-5 was broken where jna was not available
    //noinspection SimplifiableIfStatement
    if (isVersion("1.0-milestone-5")) {
        return os.isWindows() || os.isMacOsX() || os.isLinux();
    } else {
        return true;
    }
}
 
Example 7
Source File: ToolSearchPath.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private File maybeResolveFile(OperatingSystem operatingSystem, File symlinkCandidate, File exeCandidate) throws IOException {
    if (exeCandidate.isFile()) {
        return exeCandidate;
    }
    if (operatingSystem.isWindows()) {
        File symlink = maybeResolveCygwinSymlink(symlinkCandidate);
        if (symlink != null) {
            return symlink;
        }
    }
    return null;
}
 
Example 8
Source File: DefaultGradleDistribution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public boolean worksWith(OperatingSystem os) {
    // 1.0-milestone-5 was broken where jna was not available
    //noinspection SimplifiableIfStatement
    if (isVersion("1.0-milestone-5")) {
        return os.isWindows() || os.isMacOsX() || os.isLinux();
    } else {
        return true;
    }
}
 
Example 9
Source File: NativeServices.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected WindowsRegistry createWindowsRegistry(OperatingSystem operatingSystem) {
    if (useNativePlatform && operatingSystem.isWindows()) {
        return io.rubygrapefruit.platform.Native.get(WindowsRegistry.class);
    }
    return notAvailable(WindowsRegistry.class);
}
 
Example 10
Source File: NativeServices.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected WindowsRegistry createWindowsRegistry(OperatingSystem operatingSystem) {
    if (useNativePlatform && operatingSystem.isWindows()) {
        return io.rubygrapefruit.platform.Native.get(WindowsRegistry.class);
    }
    return notAvailable(WindowsRegistry.class);
}
 
Example 11
Source File: NativeServices.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected WindowsRegistry createWindowsRegistry(OperatingSystem operatingSystem) {
    if (useNativePlatform && operatingSystem.isWindows()) {
        return io.rubygrapefruit.platform.Native.get(WindowsRegistry.class);
    }
    return notAvailable(WindowsRegistry.class);
}
 
Example 12
Source File: NativeServices.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected WindowsRegistry createWindowsRegistry(OperatingSystem operatingSystem) {
    if (useNativePlatform && operatingSystem.isWindows()) {
        return io.rubygrapefruit.platform.Native.get(WindowsRegistry.class);
    }
    return notAvailable(WindowsRegistry.class);
}