@@ -18,36 +18,6 @@ apply plugin: 'com.bmuschko.docker-remote-api'
1818
1919import com.bmuschko.gradle.docker.tasks.image.*
2020
21- task copyShimSrc (type : Copy ) {
22- from project(' :fabric-chaincode-shim' ). getProjectDir()
23- into(' build/distributions/chaincode-java/shim-src/fabric-chaincode-shim/' )
24- }
25-
26- task copyProtosSrc (type : Copy ) {
27- from project(' :fabric-chaincode-protos' ). getProjectDir()
28- into(' build/distributions/chaincode-java/shim-src/fabric-chaincode-protos/' )
29- }
30-
31- task copyBuildFile (type : Copy ) {
32- from project. getParent(). file(" build.gradle" )
33- into(' build/distributions/chaincode-java/shim-src/' )
34- }
35-
36- task copySettingsFile (type : Copy ) {
37- from project. getParent(). file(" settings.gradle" )
38- into(' build/distributions/chaincode-java/shim-src/' )
39- }
40-
41- task copyGradleExampleProject (type : Copy ) {
42- from project. getParent(). file(" fabric-chaincode-example-gradle" )
43- into(' build/distributions/chaincode-java/example-src/fabric-chaincode-example-gradle' )
44- }
45-
46- task copyMavenExampleProject (type : Copy ) {
47- from project. getParent(). file(" fabric-chaincode-example-maven" )
48- into(' build/distributions/chaincode-java/example-src/fabric-chaincode-example-maven' )
49- }
50-
5121task copyLib (type : Copy ) {
5222 dependsOn ' :fabric-chaincode-shim:build'
5323 from project(' :fabric-chaincode-shim' ). configurations. runtime
@@ -72,14 +42,41 @@ task copyBuildScript(type: Copy) {
7242 into (' build/distributions/chaincode-java' )
7343}
7444
75- task buildImage (type : DockerBuildImage ) {
45+ task copyAllDeps (type : Copy ) {
7646 dependsOn copyBuildScript
77- dependsOn copyShimSrc
78- dependsOn copyProtosSrc
79- dependsOn copyBuildFile
80- dependsOn copySettingsFile
81- dependsOn copyGradleExampleProject
82- dependsOn copyMavenExampleProject
47+ copy {
48+ from project(' :fabric-chaincode-shim' ). getProjectDir()
49+ into(' build/distributions/chaincode-java/shim-src/fabric-chaincode-shim/' )
50+ }
51+
52+ copy {
53+ from project(' :fabric-chaincode-protos' ). getProjectDir()
54+ into(' build/distributions/chaincode-java/shim-src/fabric-chaincode-protos/' )
55+ }
56+
57+ copy {
58+ from project. getParent(). file(" build.gradle" )
59+ into(' build/distributions/chaincode-java/shim-src/' )
60+ }
61+
62+ copy {
63+ from project. getParent(). file(" settings.gradle" )
64+ into(' build/distributions/chaincode-java/shim-src/' )
65+ }
66+
67+ copy {
68+ from project. getParent(). file(" fabric-chaincode-example-gradle" )
69+ into(' build/distributions/chaincode-java/example-src/fabric-chaincode-example-gradle' )
70+ }
71+
72+ copy {
73+ from project. getParent(). file(" fabric-chaincode-example-maven" )
74+ into(' build/distributions/chaincode-java/example-src/fabric-chaincode-example-maven' )
75+ }
76+ }
77+
78+ task buildImage (type : DockerBuildImage ) {
79+ dependsOn copyAllDeps
8380 inputDir = project. file(' Dockerfile' ). parentFile
8481 tags = [' hyperledger/fabric-javaenv' , ' hyperledger/fabric-javaenv:x86_64-latest' , ' hyperledger/fabric-javaenv:x86_64-1.2.0' , ' hyperledger/fabric-javaenv:amd64-1.2.0' , ' hyperledger/fabric-javaenv:amd64-latest' ]
8582}
0 commit comments