Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ProtobufPlugin to support multiple languages #76

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6a35a02
Refactor plugin for more language support
peter-ng-ullink May 27, 2016
7c42ca5
Fix broken signature part
ngyukman May 27, 2016
84ab62a
Fix Java build
ngyukman May 28, 2016
f67d166
Fix sourceSets issues
ngyukman May 28, 2016
f5740c6
Allow applying multiple protobuf plugins
ngyukman May 28, 2016
5638ef0
Remove unused import
ngyukman May 28, 2016
ac787ce
Apply project.afterEvaluate on base instead of per plugin
ngyukman May 29, 2016
9b5bba0
Add basic unit test for ProtobufJavaPlugin
ngyukman May 29, 2016
2ef8b3b
Remove csharp change in the commit
ngyukman May 29, 2016
9d7b9be
Rewrite java unit test on spock
ngyukman May 29, 2016
c296131
make ProtobufPluginTestHelper function to static
ngyukman May 29, 2016
7479d13
Refactor on fileResolver and support suffix in configuration
ngyukman May 29, 2016
a9327cd
Remove unused import
ngyukman Jun 7, 2016
8def571
Move testProjectAndroid to new testing framework
ngyukman Jun 9, 2016
45d3980
Fix test project didn't run correctly
ngyukman Jun 10, 2016
c18424e
Add back assertion on testProject
ngyukman Jun 10, 2016
2020e16
Merge remote-tracking branch 'upstream/master'
ngyukman Jun 10, 2016
5b52f1e
Remove gradlew install in ci
ngyukman Jun 10, 2016
f432202
Fix android test
ngyukman Jun 10, 2016
e2cdb60
Ignore InvalidPackage in lint due to okio
ngyukman Jun 10, 2016
b8a1989
Refactor on test cases with multiple projects
ngyukman Jun 11, 2016
b7f15b8
Merge remote-tracking branch 'upstream/master'
ngyukman Jun 15, 2016
7c76352
Fix according to comments
ngyukman Jun 15, 2016
083d41d
Update indentation
ngyukman Jul 21, 2016
e364dc6
Fix typo on var name
ngyukman Jul 21, 2016
b9e5279
Update indentation
ngyukman Jul 22, 2016
7b2b399
Improve running of test projects
ngyukman Jul 24, 2016
7f6036b
Update tests indentation
ngyukman Jul 24, 2016
fb74e49
Merge branch
ngyukman Aug 1, 2016
8bac2da
Merge upstream/master
ngyukman Aug 1, 2016
caa4c59
Remove duplicate file
ngyukman Aug 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ Tools](https://developer.android.com/sdk/index.html#Other).
After you made any change to the plugin, be sure to run these tests.
```
$ ./gradlew test
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ package com.google.protobuf.gradle

import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.tasks.SourceSet
import org.gradle.util.ConfigureUtil

Expand All @@ -50,12 +49,12 @@ public class ProtobufConfigurator {
*/
public String generatedFilesBaseDir

public ProtobufConfigurator(Project project, FileResolver fileResolver) {
public ProtobufConfigurator(Project project) {
this.project = project
if (Utils.isAndroidProject(project)) {
tasks = new AndroidGenerateProtoTaskCollection()
} else {
tasks = new JavaGenerateProtoTaskCollection()
tasks = new DefaultGenerateProtoTaskCollection()
}
tools = new ToolsLocator(project)
taskConfigClosures = new ArrayList()
Expand Down Expand Up @@ -150,7 +149,7 @@ public class ProtobufConfigurator {
}
}

public class JavaGenerateProtoTaskCollection
public class DefaultGenerateProtoTaskCollection
extends GenerateProtoTaskCollection {
public Collection<GenerateProtoTask> ofSourceSet(String sourceSet) {
return all().findAll { task ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ package com.google.protobuf.gradle
import com.google.common.collect.ArrayListMultimap
import com.google.common.collect.Multimap
import org.gradle.api.Project
import org.gradle.api.internal.file.FileResolver
import org.gradle.util.ConfigureUtil

/**
* Adds the protobuf {} block as a property of the project.
*/
class ProtobufConvention {
def ProtobufConvention(Project project, FileResolver fileResolver) {
protobuf = new ProtobufConfigurator(project, fileResolver)
def ProtobufConvention(Project project) {
protobuf = new ProtobufConfigurator(project)
}

def final ProtobufConfigurator protobuf
Expand Down
Loading