nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From be4c852769e260e3a9b516bb5626a6a6a68a2cd3 Mon Sep 17 00:00:00 2001
2From: roblabla <unfiltered@roblab.la>
3Date: Wed, 31 Jan 2024 13:19:55 +0100
4Subject: [PATCH] Use com.google.protobuf:protobuf-gradle-plugin
5
6---
7 Ghidra/Debug/Debugger-isf/build.gradle | 8 +-
8 Ghidra/Debug/Debugger-rmi-trace/build.gradle | 16 ++--
9 build.gradle | 6 ++
10 gradle/hasProtobuf.gradle | 94 --------------------
11 4 files changed, 22 insertions(+), 102 deletions(-)
12 delete mode 100644 gradle/hasProtobuf.gradle
13
14diff --git a/Ghidra/Debug/Debugger-isf/build.gradle b/Ghidra/Debug/Debugger-isf/build.gradle
15index f6c8464405..396b52d188 100644
16--- a/Ghidra/Debug/Debugger-isf/build.gradle
17+++ b/Ghidra/Debug/Debugger-isf/build.gradle
18@@ -18,11 +18,17 @@ apply from: "${rootProject.projectDir}/gradle/javaProject.gradle"
19 apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"
20 apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
21 apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
22-apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle"
23
24+apply plugin: 'com.google.protobuf'
25 apply plugin: 'eclipse'
26 eclipse.project.name = 'Debug Debugger-isf'
27
28+buildscript {
29+ dependencies {
30+ classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
31+ }
32+}
33+
34 dependencies {
35 api project(':Framework-AsyncComm')
36 api project(':ProposedUtils')
37diff --git a/Ghidra/Debug/Debugger-rmi-trace/build.gradle b/Ghidra/Debug/Debugger-rmi-trace/build.gradle
38index 8b6589f035..05da5a7a7e 100644
39--- a/Ghidra/Debug/Debugger-rmi-trace/build.gradle
40+++ b/Ghidra/Debug/Debugger-rmi-trace/build.gradle
41@@ -19,12 +19,17 @@ apply from: "${rootProject.projectDir}/gradle/helpProject.gradle"
42 apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"
43 apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
44 apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
45-apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle"
46 apply from: "${rootProject.projectDir}/gradle/hasPythonPackage.gradle"
47-
48+apply plugin: 'com.google.protobuf'
49 apply plugin: 'eclipse'
50 eclipse.project.name = 'Debug Debugger-rmi-trace'
51
52+buildscript {
53+ dependencies {
54+ classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
55+ }
56+}
57+
58 dependencies {
59 api project(':Pty')
60 api project(':Debugger')
61@@ -44,12 +49,9 @@ task generateProtoPy {
62 ext.outdir = file("build/generated/source/proto/main/py")
63 outputs.dir(outdir)
64 inputs.files(src)
65- dependsOn(configurations.protocArtifact)
66+ dependsOn(protobuf.generateProtoTasks.all())
67 doLast {
68- def exe = configurations.protocArtifact.first()
69- if (!isCurrentWindows()) {
70- exe.setExecutable(true)
71- }
72+ def exe = protobuf.tools.protoc.path
73 exec {
74 commandLine exe, "--python_out=$outdir", "-I$srcdir"
75 args src
76diff --git a/build.gradle b/build.gradle
77index 2d75307a08..aa8f1d7604 100644
78--- a/build.gradle
79+++ b/build.gradle
80@@ -80,6 +80,12 @@ if (flatRepo.isDirectory()) {
81 mavenCentral()
82 flatDir name: "flat", dirs:["$flatRepo"]
83 }
84+ buildscript {
85+ repositories {
86+ mavenLocal()
87+ mavenCentral()
88+ }
89+ }
90 }
91 }
92 else {
93diff --git a/gradle/hasProtobuf.gradle b/gradle/hasProtobuf.gradle
94deleted file mode 100644
95index 23b4ce74bb..0000000000
96--- a/gradle/hasProtobuf.gradle
97+++ /dev/null
98@@ -1,94 +0,0 @@
99-/* ###
100- * IP: GHIDRA
101- *
102- * Licensed under the Apache License, Version 2.0 (the "License");
103- * you may not use this file except in compliance with the License.
104- * You may obtain a copy of the License at
105- *
106- * http://www.apache.org/licenses/LICENSE-2.0
107- *
108- * Unless required by applicable law or agreed to in writing, software
109- * distributed under the License is distributed on an "AS IS" BASIS,
110- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111- * See the License for the specific language governing permissions and
112- * limitations under the License.
113- */
114-/*plugins {
115- id 'com.google.protobuf' version '0.8.10'
116-}*/
117-
118-configurations {
119- allProtocArtifacts
120- protocArtifact
121-}
122-
123-def platform = getCurrentPlatformName()
124-
125-
126-dependencies {
127- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
128- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
129- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
130- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
131- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
132-
133- if (isCurrentWindows()) {
134- protocArtifact 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
135- }
136- if (isCurrentLinux()) {
137- if (platform.endsWith("x86_64")) {
138- protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
139- }
140- else {
141- protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
142- }
143- }
144- if (isCurrentMac()) {
145- if (platform.endsWith("x86_64")) {
146- protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
147- }
148- else {
149- protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
150- }
151- }
152-}
153-
154-/*protobuf {
155- protoc {
156- artifact = 'com.google.protobuf:protoc:3.21.8'
157- }
158-}*/
159-
160-task generateProto {
161- ext.srcdir = file("src/main/proto")
162- ext.src = fileTree(srcdir) {
163- include "**/*.proto"
164- }
165- ext.outdir = file("build/generated/source/proto/main/java")
166- outputs.dir(outdir)
167- inputs.files(src)
168- dependsOn(configurations.protocArtifact)
169- doLast {
170- def exe = configurations.protocArtifact.first()
171- if (!isCurrentWindows()) {
172- exe.setExecutable(true)
173- }
174- exec {
175- commandLine exe, "--java_out=$outdir", "-I$srcdir"
176- args src
177- }
178- }
179-}
180-
181-tasks.compileJava.dependsOn(tasks.generateProto)
182-tasks.eclipse.dependsOn(tasks.generateProto)
183-rootProject.tasks.prepDev.dependsOn(tasks.generateProto)
184-
185-sourceSets {
186- main {
187- java {
188- srcDir tasks.generateProto.outdir
189- }
190- }
191-}
192-zipSourceSubproject.dependsOn generateProto
193--
1942.47.0
195