Package org.gradle.api

Examples of org.gradle.api.InvalidUserDataException


                    );
            return;
        }
        if (!zipFile.isFile())
        {
            throw new InvalidUserDataException(String.format("Cannot expand %s as it is not a file.", getDisplayName()));
        }

        AtomicBoolean stopFlag = new AtomicBoolean();

        try
View Full Code Here


    public void reobf(Task task, Closure<Object> artifactSpec)
    {
        if (!(task instanceof AbstractArchiveTask))
        {
            throw new InvalidUserDataException("You cannot reobfuscate tasks that are not 'archive' tasks, such as 'jar', 'zip' etc. (you tried to sign $task)");
        }

        ArtifactSpec spec = new ArtifactSpec((AbstractArchiveTask) task);
        artifactSpec.call(spec);
View Full Code Here

    {
        for (Task task : tasks)
        {
            if (!(task instanceof AbstractArchiveTask))
            {
                throw new InvalidUserDataException("You cannot reobfuscate tasks that are not 'archive' tasks, such as 'jar', 'zip' etc. (you tried to sign $task)");
            }

            dependsOn(task);
            addArtifact(new ObfArtifact(new DelayedThingy(task), new ArtifactSpec((AbstractArchiveTask) task), this));
        }
View Full Code Here

    void generate(ReobfExceptor exc, File defaultSrg, File extraSrg) throws Exception
    {
        File toObf = getToObf();
        if (toObf == null)
        {
            throw new InvalidUserDataException("Unable to obfuscate as the file to obfuscate has not been specified");
        }

        // ready artifacts
        File output = getFile();
        File toObfTemp = File.createTempFile("reobfed", ".jar", caller.getTemporaryDir());
View Full Code Here

        for (Map.Entry<String, String> entry : mapping.entrySet()) {
            String headerType = entry.getValue().toUpperCase();
            String fileType = entry.getKey().toLowerCase();
            if (!validHeaderTypes.contains(headerType)) {
                throw new InvalidUserDataException(String.format("The provided header type (%s) for %s is invalid", headerType, fileType));
            }
            extensionMapping.put(fileType, headerType);
        }
        // force inclusion of unknown item to manage unknown files
        extensionMapping.put(DocumentType.UNKNOWN.getExtension(), DocumentType.UNKNOWN.getDefaultHeaderTypeName());
View Full Code Here

        releaseVariant = variant;
        break;
      }
    }
    if (releaseVariant == null) {
      throw new InvalidUserDataException(String.format(
          "Cannot find %s variant for android configuration", variantName));
    }

    return releaseVariant.getOutputFile();
  }
View Full Code Here

      Commit commitRequest = edits.commit(publisherExtension.getPackageName(), editId);
      AppEdit appEdit = commitRequest.execute();
      getLogger().info(String.format("App edit with id %s has been committed", appEdit.getId()));

    } catch (IOException e) {
      throw new InvalidUserDataException(
          String.format("Exception was thrown while uploading APK to the %s track: %s",
              publisherExtension.getTrack(), e.getMessage()),
          e);
    } catch (GeneralSecurityException e) {
      throw new InvalidUserDataException(
          String.format("Exception was thrown while uploading APK to the %s track: %s",
              publisherExtension.getTrack(), e.getMessage()),
          e);
    }
  }
View Full Code Here

          destinationTrack = track;
      }

      // Error checking
      if (sourceTrack==null || destinationTrack==null) {
        throw new InvalidUserDataException(String.format(
            "Cannot find the %s or %s track on Google Play, invalid track name?",
            publisherExtension.getTrack(), publisherExtension.getPromotionTrack()
        ));
      }
      if (sourceTrack.getVersionCodes().size()==0) {
        throw new InvalidUserDataException(String.format(
            "Cannot find a valid APK version code for the %s track, does it have at least one APK already uploaded?",
            sourceTrack.getVersionCodes()
        ));
      }
      getLogger().info("Using source track {} with version codes {}",
          sourceTrack.getTrack(), sourceTrack.getVersionCodes());
      getLogger().info("Using destination track {} with version codes {}",
          destinationTrack.getTrack(), destinationTrack.getVersionCodes());

      // Find version code to promote, remove from source track and add to destination track
      Integer versionCode = Collections.max(sourceTrack.getVersionCodes());
      List<Integer> sourceVersionCodes = sourceTrack.getVersionCodes();
      sourceVersionCodes.remove(versionCode);
      sourceTrack.setVersionCodes(sourceVersionCodes);
      List<Integer> destinationVersionCodes = new ArrayList<Integer>();
      destinationVersionCodes.add(versionCode);
      destinationTrack.setVersionCodes(destinationVersionCodes);
      getLogger().info("Promoting version code {}", versionCode);

      Update sourceUpdateRequest = edits
          .tracks()
          .update(publisherExtension.getPackageName(),
              editId,
              sourceTrack.getTrack(), sourceTrack);
      sourceUpdateRequest.execute();
      getLogger().info(String.format("Source track %s has been updated", sourceTrack.getTrack()));
      Update destinationUpdateRequest = edits
          .tracks()
          .update(publisherExtension.getPackageName(),
              editId,
              destinationTrack.getTrack(), destinationTrack);
      getLogger().info(String.format("Destination track %s has been updated",
          destinationTrack.getTrack()));
      destinationUpdateRequest.execute();

      // Commit changes for edit.
      Commit commitRequest = edits.commit(publisherExtension.getPackageName(), editId);
      AppEdit appEdit = commitRequest.execute();
      getLogger().info(String.format("App edit with id %s has been committed", appEdit.getId()));
      getLogger().lifecycle("Version code {} has been promoted from the {} to the {} track",
          versionCode, sourceTrack.getTrack(), destinationTrack.getTrack());
    } catch (IOException e) {
      throw new InvalidUserDataException(
          String.format("Exception was thrown while promoting APK from the %s track to the %s track: %s",
              publisherExtension.getTrack(),
              publisherExtension.getPromotionTrack(),
              e.getMessage()),
          e);
    } catch (GeneralSecurityException e) {
      throw new InvalidUserDataException(
          String.format("Exception was thrown while promoting APK from the %s track to the %s track: %s",
              publisherExtension.getTrack(),
              publisherExtension.getPromotionTrack(),
              e.getMessage()),
          e);
View Full Code Here

        this.artifactPomFactory = artifactPomFactory;
    }

    public void addArtifact(Artifact artifact, File src) {
        if (artifact == null || src == null) {
            throw new InvalidUserDataException("Artifact or source file must not be null!");
        }
        for (PomFilter activePomFilter : pomFilterContainer.getActivePomFilters()) {
            if (activePomFilter.getFilter().accept(artifact, src)) {
                if (artifactPoms.get(activePomFilter.getName()) == null) {
                    artifactPoms.put(activePomFilter.getName(), artifactPomFactory.createArtifactPom(activePomFilter.getPomTemplate()));
View Full Code Here

    private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
        Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
        boolean hasArtifactType = matcher.matches();
        if (hasArtifactType && !ClientModule.class.isAssignableFrom(wantedType)) {
            if (matcher.groupCount() != 2) {
                throw new InvalidUserDataException("The dependency notation " + notation + " is invalid");
            }
            return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
        }
        return new ParsedModuleStringNotation(notation, null);
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.InvalidUserDataException

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.