< prev index next >

build.gradle

Print this page

121     throw new GradleException("Unexpected operating system: " + os)
122 }
123 
124 def getCPU() {
125     def cpu = System.getProperty('os.arch').toLowerCase()
126     if (cpu.startsWith('amd64') || cpu.startsWith('x86_64') || cpu.startsWith('x64')) {
127         return 'x64'
128     }
129     if (cpu.startsWith('x86') || cpu.startsWith('i386')) {
130         return 'x86'
131     }
132     if (cpu.startsWith('sparc')) {
133         return 'sparc'
134     }
135     if (cpu.startsWith('ppc')) {
136         return 'ppc'
137     }
138     if (cpu.startsWith('arm')) {
139         return 'arm'
140     }
141     throw new GradleException("Unexpected operating system: " + cpu)



142 }
143 
144 task local(type: Copy) {
145     doFirst {
146         delete project.buildDir
147     }
148 
149     def os = getOS()
150     def cpu = getCPU()
151 
152     if (os in ['linux', 'macos', 'windows'] && cpu == 'x64') {
153         def target = os.substring(0, 1).toUpperCase() + os.substring(1) +
154                      cpu.substring(0, 1).toUpperCase() + cpu.substring(1)
155         dependsOn ':cli:image' + target
156     } else {
157         dependsOn ':cli:imageLocal'
158     }
159 
160     from zipTree(file(project.rootDir.toString() +
161                       '/cli/build/distributions/cli' +

121     throw new GradleException("Unexpected operating system: " + os)
122 }
123 
124 def getCPU() {
125     def cpu = System.getProperty('os.arch').toLowerCase()
126     if (cpu.startsWith('amd64') || cpu.startsWith('x86_64') || cpu.startsWith('x64')) {
127         return 'x64'
128     }
129     if (cpu.startsWith('x86') || cpu.startsWith('i386')) {
130         return 'x86'
131     }
132     if (cpu.startsWith('sparc')) {
133         return 'sparc'
134     }
135     if (cpu.startsWith('ppc')) {
136         return 'ppc'
137     }
138     if (cpu.startsWith('arm')) {
139         return 'arm'
140     }
141     if (cpu.startsWith('aarch64')) {
142         return 'aarch64';
143     }
144     throw new GradleException("Unexpected CPU: " + cpu)
145 }
146 
147 task local(type: Copy) {
148     doFirst {
149         delete project.buildDir
150     }
151 
152     def os = getOS()
153     def cpu = getCPU()
154 
155     if (os in ['linux', 'macos', 'windows'] && cpu == 'x64') {
156         def target = os.substring(0, 1).toUpperCase() + os.substring(1) +
157                      cpu.substring(0, 1).toUpperCase() + cpu.substring(1)
158         dependsOn ':cli:image' + target
159     } else {
160         dependsOn ':cli:imageLocal'
161     }
162 
163     from zipTree(file(project.rootDir.toString() +
164                       '/cli/build/distributions/cli' +
< prev index next >