-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the current standard for plugins. It makes the builds faster by supporting heavy parallelism in builds, and slow whenever a non-compliant plugin is part of the build.
- Loading branch information
Showing
28 changed files
with
417 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2024 Buf Technologies, 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 build.buf.gradle | ||
|
||
import org.gradle.api.file.ConfigurableFileCollection | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.InputFiles | ||
import java.io.File | ||
|
||
/** | ||
* A task executing buf executable as part of its operation. | ||
*/ | ||
abstract class AbstractBufExecTask : AbstractBufTask() { | ||
/** The buf executable. */ | ||
@get:InputFiles | ||
internal abstract val bufExecutable: ConfigurableFileCollection | ||
|
||
/** | ||
* The directory in which buf is executed. | ||
* The actual real input files in this directory have to be tracked per command separately, | ||
* so it is just an @Input, not @InputDirectory. | ||
*/ | ||
@get:Input | ||
internal abstract val workingDir: Property<File> | ||
|
||
/** Whether the project has protobuf plugin enabled. */ | ||
@get:Input | ||
internal abstract val hasProtobufGradlePlugin: Property<Boolean> | ||
|
||
/** Directories possibly containing input .proto files. */ | ||
@get:InputFiles | ||
internal abstract val candidateProtoDirs: ConfigurableFileCollection | ||
|
||
/** Whether the project has buf workspace or not. */ | ||
@get:Input | ||
internal abstract val hasWorkspace: Property<Boolean> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2024 Buf Technologies, 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 build.buf.gradle | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import java.io.File | ||
|
||
abstract class AbstractBufTask : DefaultTask() { | ||
/** | ||
* This property has to be set to project directory. It is only used for relativization of paths, | ||
* so it is just an @Input, not @InputDirectory. | ||
*/ | ||
@get:Input | ||
internal abstract val projectDir: Property<File> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.