• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package aconfig
18 
19 import org.gradle.api.file.DirectoryProperty
20 import org.gradle.api.file.RegularFileProperty
21 import org.gradle.api.tasks.AbstractExecTask
22 import org.gradle.api.tasks.InputFile
23 import org.gradle.api.tasks.OutputDirectory
24 
25 abstract class AConfigCreateJavaLibTask :
26     AbstractExecTask<AConfigCreateJavaLibTask>(AConfigCreateJavaLibTask::class.java) {
27 
28     @get:InputFile
29     abstract val aconfigPath: RegularFileProperty
30 
31     @get:InputFile
32     abstract val cacheFile: RegularFileProperty
33 
34     @get:OutputDirectory
35     abstract val outputFolder: DirectoryProperty
36 
execnull37     override fun exec() {
38         commandLine(aconfigPath.get())
39         args(
40             "create-java-lib",
41             "--mode",
42             "production",
43             "--cache",
44             cacheFile.get(),
45             "--out",
46             outputFolder.get()
47         )
48         super.exec()
49     }
50 }
51