Skip to content

Commit e3be99e

Browse files
committed
[FAB-9407]: Extract JavaCC shim protos
This commit moves out proto definition files out of the shim subproject into indendepent subproject, while providing compile time dependcies to link both subprojects. In addition rename shim subproject into fabric-chaincode-shim to align with maven publishable artifact name, thus supporting `./gradlew clean build install`, making it to push into .m2 artifact with correct file name (same as nexus). Change-Id: Id14152a6f60165805bc85c6b45cfeb571642b1ca Signed-off-by: Artem Barger <bartem@il.ibm.com>
1 parent e4c9867 commit e3be99e

File tree

68 files changed

+33596
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+33596
-206
lines changed

.gitignore

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
/.gradle/
21
/.settings/
32
/.project
4-
/.idea
5-
*.iml
63
*.log
74
*.swp
85
.gradletasknamecache
6+
.classpath
7+
/bin/
8+
/build/
9+
build/*
10+
11+
.gradle
12+
/build/
13+
out/
14+
!gradle/wrapper/gradle-wrapper.jar
15+
16+
### STS ###
17+
.apt_generated
18+
.classpath
19+
.factorypath
20+
.project
21+
.settings
22+
.springBeans
23+
24+
### IntelliJ IDEA ###
25+
.idea
26+
*.iws
27+
*.iml
28+
*.ipr
29+
30+
### NetBeans ###
31+
nbproject/private/
32+
build/
33+
nbbuild/
34+
dist/
35+
nbdist/
36+
.nb-gradle/
37+
38+
local-config.yaml
39+
gradle.properties

build.gradle

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ apply plugin: 'idea'
88
apply plugin: 'eclipse-wtp'
99

1010
allprojects {
11-
repositories {
12-
mavenLocal()
13-
jcenter()
14-
}
11+
repositories {
12+
mavenLocal()
13+
jcenter()
14+
}
1515
}
1616

1717
subprojects {
18-
apply plugin: 'java'
19-
apply plugin: 'maven'
18+
apply plugin: 'java'
19+
apply plugin: 'maven'
2020

21-
group = "org.hyperledger.fabric"
22-
version = '1.2.0-SNAPSHOT'
21+
group = "org.hyperledger.fabric"
22+
version = '1.2.0-SNAPSHOT'
2323

24-
sourceCompatibility = 1.8
25-
targetCompatibility = 1.8
24+
sourceCompatibility = 1.8
25+
targetCompatibility = 1.8
2626

27-
dependencies {
28-
compile 'commons-cli:commons-cli:1.4'
29-
compile 'commons-logging:commons-logging:1.2'
27+
dependencies {
28+
compile 'commons-cli:commons-cli:1.4'
29+
compile 'commons-logging:commons-logging:1.2'
3030

31-
testCompile 'junit:junit:4.12'
32-
testCompile 'org.hamcrest:hamcrest-library:1.3'
33-
testCompile 'org.mockito:mockito-core:2.+'
34-
}
31+
testCompile 'junit:junit:4.12'
32+
testCompile 'org.hamcrest:hamcrest-library:1.3'
33+
testCompile 'org.mockito:mockito-core:2.+'
34+
}
3535
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright IBM Corp. 2017 All Rights Reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
apply plugin: 'com.google.protobuf'
8+
9+
repositories {
10+
maven { url "https://plugins.gradle.org/m2/" }
11+
}
12+
13+
buildscript {
14+
repositories {
15+
maven { url "https://plugins.gradle.org/m2/" }
16+
}
17+
dependencies {
18+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.5'
19+
}
20+
}
21+
22+
dependencies {
23+
compile 'com.google.protobuf:protobuf-java:3.0.0'
24+
compile 'com.google.protobuf:protobuf-java-util:3.0.0'
25+
compile 'io.grpc:grpc-netty:1.6.1'
26+
compile 'io.grpc:grpc-protobuf:1.6.1'
27+
compile 'io.grpc:grpc-stub:1.6.1'
28+
}
29+
30+
protobuf {
31+
protoc {
32+
// download the protobuf compiler
33+
artifact = 'com.google.protobuf:protoc:3.0.0'
34+
}
35+
plugins {
36+
// define grpc plugin for the protobuf compiler
37+
grpc {
38+
artifact = 'io.grpc:protoc-gen-grpc-java:1.6.1'
39+
}
40+
}
41+
generateProtoTasks {
42+
all()*.plugins {
43+
// apply the grpc plugin for the protobuf compiler
44+
grpc {}
45+
}
46+
}
47+
48+
generatedFilesBaseDir = "$projectDir/src"
49+
}
50+
51+
sourceSets {
52+
main {
53+
java {
54+
srcDirs = ['src/main/java', 'src/main/grpc']
55+
}
56+
proto {
57+
srcDirs 'src/main/proto'
58+
}
59+
}
60+
}

shim/src/main/proto/common/common.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/common/common.proto

File renamed without changes.

shim/src/main/proto/ledger/queryresult/kv_query_result.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/ledger/queryresult/kv_query_result.proto

File renamed without changes.

shim/src/main/proto/peer/chaincode.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/peer/chaincode.proto

File renamed without changes.

shim/src/main/proto/peer/chaincode_event.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/peer/chaincode_event.proto

File renamed without changes.

shim/src/main/proto/peer/chaincode_shim.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/peer/chaincode_shim.proto

File renamed without changes.

shim/src/main/proto/peer/proposal.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/peer/proposal.proto

File renamed without changes.

shim/src/main/proto/peer/proposal_response.proto renamed to fabric-chaincode-protos/build/extracted-include-protos/test/peer/proposal_response.proto

File renamed without changes.

0 commit comments

Comments
 (0)