// Copyright 2017 Google Inc. All rights reserved.
//
// 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 java

import (
	"android/soong/android"
	"android/soong/genrule"
)

func init() {
	android.RegisterModuleType("java_genrule", genRuleFactory)
	android.RegisterModuleType("java_genrule_host", genRuleFactoryHost)
}

// java_genrule is a genrule that can depend on other java_* objects.
// The cmd may be run multiple times, once for each of the different host/device
// variations.
func genRuleFactory() android.Module {
	module := genrule.NewGenRule()

	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibCommon)

	return module
}

// java_genrule_host is a genrule that can depend on other java_* objects.
// The cmd may be run multiple times, once for each of the different host/device
// variations.
func genRuleFactoryHost() android.Module {
	module := genrule.NewGenRule()

	android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)

	return module
}
