/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

plugins { id 'org.apache.beam.module' }

applyJavaNature(
    automaticModuleName: 'org.apache.beam.runners.local',
    archivesBaseName: 'beam-runners-local-java-core',

)

description = "Apache Beam :: Runners :: Local Java Core"

dependencies {
  /*
   * The Local Java Core artifact should carefully manage the classes made available by this
   * dependency. The Java SDK should be used to provide common utilities (e.g. Coder, WindowedValue)
   * but should not be used within this library to execute any UDFs.
   * TODO: Add an APISurfaceTest to force this to be the case, if possible.
  */
  compile project(path: ":sdks:java:core", configuration: "shadow")
  compile library.java.joda_time
  testCompile library.java.junit
}
