Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.class
*.log
repos
project/target
target
.idea
20 changes: 0 additions & 20 deletions .gitmodules

This file was deleted.

13 changes: 1 addition & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,7 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2018 The Delphi Team (represented by Ben Hermann)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,26 @@ This source code repository bundles all of Delphi's components and provides an u
You need a running instance of [ElasticSearch](https://www.elastic.co/downloads/elasticsearch) on your local machine on port 9200.

### Running Delphi locally
After you started ElasticSearch, it is simply a matter of typing
After you started ElasticSearch, you can run delphi by following the below steps

* Cloning the projects. Needs to be done only for the first time.
```
sbt clone-all
```
* After that, just use run command

```
sbt run
```
    
into your terminal. SBT will compile and start all necessary services to run Delphi.

* Delphi components can be deleted in case all cloned components needs to be deleted using

```
sbt delete
```
    
## Components

### delphi-crawler
Expand Down
78 changes: 65 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,82 @@ name := "delphi"
version := "1.0.0-SNAPSHOT"
scalaVersion := "2.12.4"

import sys.process._
import java.io.File


lazy val repos = List("delphi-webapi", "delphi-crawler", "delphi-cli", "delphi-management")
lazy val delphiRepos = "repos"

def cloneAll = Command.command("clone-all") {
state =>
Process(s"mkdir -p $delphiRepos").!
val currDir = System.getProperty("user.dir")
for (repo <- repos) {
val bash = "/bin/bash"
val op = "-c"
val clone = s"git clone https://github.com/delphi-hub/$repo"
Process(Seq(bash, op, clone), new File(currDir + "/" + delphiRepos)).!
}
state
}





def delete = Command.command("delete") {
state =>
val currDir = System.getProperty("user.dir")
val cmd = "rm -rf " + currDir + "/" + delphiRepos
Process(cmd).!
state
}


lazy val currentBranch = taskKey[String]("Get current git branch")

currentBranch := {
Process("git rev-parse --abbrev-ref HEAD").!!
}


lazy val pull = taskKey[Unit]("Pull Changes")

pull := {
val branch = currentBranch.value
for (repo <- repos) {
BuildUtils.pull(repo, branch)
}

}

Compile / compile := ((Compile / compile) dependsOn pull).value

commands += cloneAll
commands += delete
lazy val root = (project in file("."))
.aggregate(cli, crawler, management, webapi, webapp)
.aggregate(crawler,webapi,cli,management,webapp)


lazy val webapi = Project(
id = "webapi",
base = file("repos/delphi-webapi"))

lazy val cli = Project(
id = "cli",
base = file("delphi-cli"))
id = "cli",
base = file("repos/delphi-cli"))

lazy val crawler = Project(
id = "crawler",
base = file("delphi-crawler"))
id = "crawler",
base = file("repos/delphi-crawler"))

lazy val management = Project(
id = "management",
base = file("delphi-management"))
id = "management",
base = file("repos/delphi-management"))

lazy val webapp = Project(
id = "webapp",
base = file("delphi-webapp"))

lazy val webapi = Project(
id = "webapi",
base = file("delphi-webapi"))
id = "webapp",
base = file("repos/delphi-webapp"))

addCommandAlias("run", "; all webapi/run crawler/run webapp/run management/run")
1 change: 0 additions & 1 deletion delphi-cli
Submodule delphi-cli deleted from a47de6
1 change: 0 additions & 1 deletion delphi-crawler
Submodule delphi-crawler deleted from a20ae1
1 change: 0 additions & 1 deletion delphi-management
Submodule delphi-management deleted from 0a25c2
1 change: 0 additions & 1 deletion delphi-webapi
Submodule delphi-webapi deleted from f07e5d
1 change: 0 additions & 1 deletion delphi-webapp
Submodule delphi-webapp deleted from 490efd
Binary file added img/delphi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions project/BuildUtils.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys.process._
import java.io._
object BuildUtils {
def pull(repo: String, branch: String) = {
val bash="/bin/bash"
val op="-c"
val checkout=s"git checkout $branch"
val gitPull="git pull"
Process(Seq(bash,op,checkout,gitPull),new File(repo)).!
}

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.1
sbt.version=1.1.6
6 changes: 5 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releas

// coverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12")
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12")


// scalastyle
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")