This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ab06af  Test scraper
     new 54b418c  Merge pull request #159 from atoulme/test_scraper
8ab06af is described below

commit 8ab06af1453ba1749bbab659d6c3fc3e958e5f5b
Author: Antoine Toulme <anto...@lunar-ocean.com>
AuthorDate: Mon Oct 19 00:46:37 2020 -0700

    Test scraper
---
 devp2p/build.gradle                                |  4 ++-
 .../kotlin/org/apache/tuweni/devp2p/v5/Scraper.kt  |  8 ++++--
 dist/build.gradle                                  | 29 +++++++++++++++++++---
 3 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/devp2p/build.gradle b/devp2p/build.gradle
index ee60035..563ebe1 100644
--- a/devp2p/build.gradle
+++ b/devp2p/build.gradle
@@ -30,6 +30,8 @@ dependencies {
   implementation 'org.slf4j:slf4j-api'
 
   compileOnly 'org.bouncycastle:bcprov-jdk15on'
+  runtimeOnly 'org.bouncycastle:bcprov-jdk15on'
+  runtimeOnly 'ch.qos.logback:logback-classic'
 
   testImplementation project(':junit')
   testImplementation 'org.bouncycastle:bcprov-jdk15on'
@@ -41,6 +43,6 @@ dependencies {
 }
 
 application {
-  mainClassName = 'org.apache.tuweni.devp2p.v5.ScraperAppKt'
+  mainClassName = 'org.apache.tuweni.devp2p.v5.ScraperApp'
   applicationName = 'scraper'
 }
diff --git a/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/v5/Scraper.kt 
b/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/v5/Scraper.kt
index a630075..0039699 100644
--- a/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/v5/Scraper.kt
+++ b/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/v5/Scraper.kt
@@ -27,7 +27,9 @@ import org.apache.tuweni.concurrent.coroutines.await
 import org.apache.tuweni.crypto.SECP256K1
 import org.apache.tuweni.devp2p.EthereumNodeRecord
 import org.apache.tuweni.io.Base64URLSafe
+import org.bouncycastle.jce.provider.BouncyCastleProvider
 import java.net.InetSocketAddress
+import java.security.Security
 import java.util.concurrent.ConcurrentHashMap
 import java.util.concurrent.Executors
 import java.util.concurrent.atomic.AtomicBoolean
@@ -38,11 +40,13 @@ import kotlin.coroutines.CoroutineContext
  */
 object ScraperApp {
 
-  fun main(args: List<String>) {
+  @JvmStatic
+  fun main(args: Array<String>) {
+    Security.addProvider(BouncyCastleProvider())
     run(args)
   }
 
-  fun run(args: List<String>) {
+  fun run(args: Array<String>) {
     val enrs = args.map { EthereumNodeRecord.fromRLP(Base64URLSafe.decode(it)) 
}
     val addr = InetSocketAddress("0.0.0.0", 10000)
     val seen = ConcurrentHashMap.newKeySet<EthereumNodeRecord>()
diff --git a/dist/build.gradle b/dist/build.gradle
index a7e0e82..3687352 100644
--- a/dist/build.gradle
+++ b/dist/build.gradle
@@ -10,8 +10,9 @@
  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
express or implied. See the License for the
  * specific language governing permissions and limitations under the License.
  */
-import org.gradle.crypto.checksum.Checksum
+
 import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
+import org.gradle.crypto.checksum.Checksum
 
 plugins { id 'com.bmuschko.docker-remote-api' version '3.2.3' }
 
@@ -96,6 +97,28 @@ distributions {
   }
 }
 
+task addDependencies() {
+  doLast {
+    def deps = []
+    rootProject.subprojects.each { s ->
+      s.configurations.runtimeClasspath.each {
+        if (!it.toString().contains("libs/tuweni")) {
+          deps << it
+        }
+      }
+    }
+    deps = deps.unique()
+
+    distributions.main.contents.into('lib') {
+      from(deps)
+    }
+  }
+}
+
+distZip.dependsOn addDependencies
+distTar.dependsOn addDependencies
+
+
 rootProject.subprojects.each {
   if (it != project) {
     project.distZip.dependsOn it.assemble
@@ -107,9 +130,9 @@ rootProject.subprojects.each {
 
 sourcesDistZip { zip64 = true }
 
-distTar{ compression = Compression.GZIP }
+distTar { compression = Compression.GZIP }
 
-sourcesDistTar{ compression = Compression.GZIP }
+sourcesDistTar { compression = Compression.GZIP }
 
 if (System.getenv('ENABLE_SIGNING') == 'true') {
   signing {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@tuweni.apache.org
For additional commands, e-mail: commits-h...@tuweni.apache.org

Reply via email to