Exemple #1
0
 @Override
 public ArtifactManagerState getState() {
   final ArtifactManagerState state = new ArtifactManagerState();
   for (Artifact artifact : getAllArtifactsIncludingInvalid()) {
     final ArtifactState artifactState;
     if (artifact instanceof InvalidArtifact) {
       artifactState = ((InvalidArtifact) artifact).getState();
     } else {
       artifactState = new ArtifactState();
       artifactState.setBuildOnMake(artifact.isBuildOnMake());
       artifactState.setName(artifact.getName());
       artifactState.setOutputPath(artifact.getOutputPath());
       artifactState.setRootElement(serializePackagingElement(artifact.getRootElement()));
       artifactState.setArtifactType(artifact.getArtifactType().getId());
       for (ArtifactPropertiesProvider provider : artifact.getPropertiesProviders()) {
         final ArtifactPropertiesState propertiesState =
             serializeProperties(provider, artifact.getProperties(provider));
         if (propertiesState != null) {
           artifactState.getPropertiesList().add(propertiesState);
         }
       }
       Collections.sort(
           artifactState.getPropertiesList(),
           new Comparator<ArtifactPropertiesState>() {
             @Override
             public int compare(
                 @NotNull ArtifactPropertiesState o1, @NotNull ArtifactPropertiesState o2) {
               return o1.getId().compareTo(o2.getId());
             }
           });
     }
     state.getArtifacts().add(artifactState);
   }
   return state;
 }
    @Override
    public void setUpArtifact(
        @NotNull Artifact artifact, @NotNull NewArtifactConfiguration configuration) {
      final AndroidFacet facet = AndroidArtifactUtil.getPackagedFacet(myProject, artifact);

      if (facet != null) {
        final ArtifactProperties<?> properties =
            artifact.getProperties(AndroidArtifactPropertiesProvider.getInstance());

        if (properties instanceof AndroidApplicationArtifactProperties) {
          final AndroidApplicationArtifactProperties p =
              (AndroidApplicationArtifactProperties) properties;
          p.setProGuardCfgFiles(facet.getProperties().myProGuardCfgFiles);
        }
      }
    }