/*
 * Copyright 2014-present Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.facebook.buck.rules.coercer;

import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.google.common.base.Optional;

import org.immutables.value.Value;

@Value.Immutable
@BuckStyleImmutable
interface AbstractAppleBundleDestination {
  public enum SubfolderSpec {
    ABSOLUTE,
    WRAPPER,
    EXECUTABLES,
    RESOURCES,
    FRAMEWORKS,
    SHARED_FRAMEWORKS,
    SHARED_SUPPORT,
    PLUGINS,
    JAVA_RESOURCES,
    PRODUCTS,
  }

  @Value.Parameter
  SubfolderSpec getSubfolderSpec();

  @Value.Parameter
  Optional<String> getSubpath();

}

@@ -642,16 +642,106 @@
 ercer;%0A%0A
+import com.facebook.buck.rules.RuleKey;%0Aimport com.facebook.buck.rules.RuleKeyAppendable;%0A
 import c
@@ -911,17 +911,22 @@
 ble%0A
-interface
+abstract class
  Abs
@@ -953,16 +953,45 @@
 ination 
+implements RuleKeyAppendable 
 %7B%0A  publ
@@ -1205,16 +1205,32 @@
 meter%0A  
+public abstract 
 Subfolde
@@ -1277,16 +1277,32 @@
 meter%0A  
+public abstract 
 Optional
@@ -1325,10 +1325,253 @@
 ath();%0A%0A
+  @Override%0A  public RuleKey.Builder appendToRuleKey(RuleKey.Builder builder, String key) %7B%0A    return builder%0A        .setReflectively(key + %22.subfolder_spec%22, getSubfolderSpec())%0A        .setReflectively(key + %22.subpath%22, getSubpath());%0A  %7D%0A
 %7D%0A

Make AbstractAppleBundleDestination implement RuleKeyAppendable