Package org.gradle.api

Examples of org.gradle.api.GradleException


          transformation.applyTransformations(clazz);
          clazz.writeFile(this.destinationDir.toString());
        }
      }
    } catch (Exception e) {
      throw new GradleException("An error occurred while trying to process class file ", e);
    }
  }
View Full Code Here


    }

    private static String checkResponse(ClientResponse response) {
        String msg = response.getEntity(String.class);
        if (response.getStatusInfo() != ClientResponse.Status.OK) {
            throw new GradleException(
                    "Docker API error: Failed to build Image:\n"+msg);
        }
        return msg;
    }
View Full Code Here

  public void load(final File file) {
    final Properties properties = new Properties();
    try (final InputStream in = new FileInputStream(file)) {
      properties.load(in);
    } catch (IOException e) {
      throw new GradleException(format(
        "Error while reading propertie file '%s'", file), e
      );
    }

    for (final Map.Entry<Object, Object> entry : properties.entrySet()) {
View Full Code Here

        for (ModuleDependency configurationDependency : configuration.getDependencies().withType(ModuleDependency.class)) {
            if (dependency.equals(configurationDependency)) {
                return configurationDependency;
            }
        }
        throw new GradleException("Dependency could not be found. We should never get here!");
    }
View Full Code Here

        writeProperties(getPropertiesFile());

        URL jarFileSource = Wrapper.class.getResource("/gradle-wrapper.jar");
        if (jarFileSource == null) {
            throw new GradleException("Cannot locate wrapper JAR resource.");
        }
        GFileUtils.copyURLToFile(jarFileSource, jarFileDestination);

        StartScriptGenerator generator = new StartScriptGenerator();
        generator.setApplicationName("Gradle");
View Full Code Here

                    }
                    find(cl, visited, dest);
                }
            }
        } catch (Exception e) {
            throw new GradleException(String.format("Could not determine the class-path for %s.", target), e);
        }
    }
View Full Code Here

        return rc.toString();
    }

    public static File assertInWindowsPathLengthLimitation(File file){
        if(file.getAbsolutePath().length() > WINDOWS_PATH_LIMIT){
            throw new GradleException(String.format("Cannot create file. '%s' exceeds windows path limitation of %d character.", file.getAbsolutePath(), WINDOWS_PATH_LIMIT));

        }
        return file;
    }
View Full Code Here

        byte[] bytes;
        try {
            bytes = loadBytecode(resource);
            bytes = transform(bytes);
        } catch (Exception e) {
            throw new GradleException(String.format("Could not load class '%s' from %s.", name, resource), e);
        }
        return defineClass(name, bytes, 0, bytes.length);
    }
View Full Code Here

    }

    public void evaluateAntlrResult(AntlrResult result) {
        int errorCount = result.getErrorCount();
        if (errorCount == 1) {
            throw new GradleException("There was 1 error during grammar generation");
        } else if (errorCount > 1) {
            throw new GradleException("There were "
                + errorCount
                + " errors during grammar generation");
        }
    }
View Full Code Here

    private void prepareForResolveWithErrors() {
        final ResolvedConfiguration resolvedConfiguration = context.mock(ResolvedConfiguration.class);
        prepareResolve(resolvedConfiguration, true);
        context.checking(new Expectations(){{
            one(resolvedConfiguration).rethrowFailure();
            will(throwException(new GradleException()));
        }});
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.GradleException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.