• Stars
    star
    2
  • Language
    Scala
  • Created almost 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

codingame scalakit example using git submodule to reference the scalakit

Codingame with scalakit example

The goal is to be able to use a dedicated git depot for all your codingame code while being able to easily contribute to huiwang/codingame-scala-kit project. We will use git submodules to embbed codingame-scala-kit git depot into another one.

Prerequisites

In order to be able to contribute to huiwang/codingame-scala-kit starts by forking it, my forked instance, used in the following instructions, is dacr/CodinGame-Scala-Kit, to be replace with you own.

How to use this example ?

In order to fork and/or reuse this example :

$ git clone --recurse-submodules [email protected]:dacr/codingame-with-scalakit-example.git

$ cd codingame-with-scalakit-example

$ ./enhanceMyCode

This example is just for a quick test, do not use it, instead follow the following steps with your own copy of codingame-scala-kit and not mine ;)

How this project was created ?

All the executed steps in order to create this project are the following :

$ mkdir codingame-with-scalakit-example

$ cd codingame-with-scalakit-example

$ git init

$ touch README.md

$ mkdir -p src/main/scala src/test/scala

$ git submodule add [email protected]:dacr/CodinGame-Scala-Kit.git codingame-scala-kit-forked

$ ln -s codingame-scala-kit-forked/build.sbt .

$ ln -s codingame-scala-kit-forked/project .

$ ln -s codingame-scala-kit-forked/.gitignore .

$ ln -rs codingame-scala-kit-forked/src/main/scala/com/ src/main/scala/

$ ln -rs codingame-scala-kit-forked/src/test/scala/com/ src/test/scala/

$ mkdir -p src/main/scala/mycode src/test/scala/mycode

$ echo -e 'package mycode
import com.truelaurel.codingame.logging.CGLogger._
object MyCode { 
  def main(args:String*):Unit = {
    info("Hello world")
  }
}' > src/main/scala/mycode/MyCode.scala

$ echo -e 'package mycode
import org.scalatest._
class MyCodeTest extends FlatSpec with Matchers {
  it should "pi constants must have the right value " in {
    math.Pi shouldBe 3.14 +- 0.01
  }
}
' >src/test/scala/mycode/MyCodeTest.scala

$ sbt test

$ sbt 'test-only mycode.MyCodeTest'

$ sbt 'runMain com.truelaurel.codingame.tool.bundle.BundlerMain MyCode.scala'

$ cat target/MyCode.scala 

Easy way for continuous test and bundling of one practice or challenge :

$ echo -e '#!/bin/bash

BUNDLER=com.truelaurel.codingame.tool.bundle.BundlerMain
BASENAME=$(basename $0)
NAME=${BASENAME##enhance}

echo "Continuously testing and bundling $NAME"
sbt "~ ; test-only **.${NAME}Test ; runMain $BUNDLER $NAME.scala"
' > enhance

$ chmod u+x enhance

$ ln -s enhance enhanceMyCode

$ ./enhanceMyCode

How can I contribute to codingame-scala-kit ?

you can enter into the submodule, the codingame-scala-kit-forked directory in this example, and make any changes you want as if you were direcly inside this embedded depot.

$ cd codingame-scala-kit-forked

$ vi README.md

$ git add README.md

$ git commit -m 'Add information on how to use the scalakit as a git submodule'

$ git push origin master

$ cd ..

$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   codingame-scala-kit-forked (new commits)

$ git add codingame-scala-kit-forked

$ git commit -m "Keep in sync with codingame-scala-kit-forked latest changes"

$ git push origin master

And then you'll use the github web interface, and in your own copy of codinggame-scala-kit you'll be able to create a new pull request for huiwang/codingame-scala-kit

More Repositories

1

jassh

High level scala SSH API for easy and fast operations on remote servers.
Scala
71
star
2

code-examples-manager

Software tool to manage your notes, scripts, code examples, configs,... to publish them as gists or snippets
Scala
37
star
3

zio-lmdb

Lightning Memory Database (LMDB) for scala ZIO
Scala
36
star
4

jajmx

scala JMX API
Scala
31
star
5

sotohp

Photos management
Scala
27
star
6

scala-drools-dummy-project

Minimalist scala drools project
Scala
19
star
7

coursier-launcher

coursier docker container for efficient application or service download and startup
Makefile
9
star
8

zwords

A wordle game for communities
Scala
8
star
9

jaseries

scala API for time numerical series operations.
Scala
7
star
10

primes

Playing with primes using scala language. Draw Ulam spiral, ...
Scala
7
star
11

zio-worksheet

Simplified ZIO user experience in REPL, worksheet or script contexts
Scala
6
star
12

bootstrap

scala script bootstrap mechanism with #include support
Scala
6
star
13

the-weakest-link

Scala
4
star
14

custom-collection

Custom scala collection examples
Scala
4
star
15

scala-dummy-project

scala dummy project with standalone executable jar
Shell
3
star
16

drools-scripting

Drools made easy to use for scripting or testing purposes
Scala
2
star
17

simple-plugin-architecture

Scala simple plugin architecture (with plugin automatic compilation if required)
Scala
2
star
18

exproxy

a 2005 personal project...
Java
2
star
19

cntlm

dockerized cntlm
Shell
2
star
20

primes-scalatra-app

Scala
1
star
21

naturalsort

scala naturalsort algorithm
Scala
1
star
22

web-echo

A websocket/webhook JSON data recorder with API
Scala
1
star
23

akka-sandbox

temporary project to test and learn AKKA 2
Scala
1
star
24

advent-of-code-2023

Scala
1
star
25

bullyboy

sha1 brute force attack
Scala
1
star
26

the-rules-for-good-code-examples

Several rules to write the best possible source code examples
1
star
27

data-recorder

Scala
1
star
28

advent-of-code-2020

Scala
1
star
29

jenkins-phantomjs-slave

jenkins slave with phantomjs 1.9 docker image
1
star
30

dock-primesui

Shell
1
star
31

jenkins

Jenkins docker image
Shell
1
star