Skip to content

Commit c34bc8c

Browse files
committed
Cross-compile to Scala 2.12. Also bring into pico-works organisation
1 parent 7bcc6dc commit c34bc8c

File tree

12 files changed

+31
-73
lines changed

12 files changed

+31
-73
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name := "hashids-scala"
22

3-
organization := "io.john-ky"
3+
organization := "pico-works"
44

5-
crossScalaVersions := Seq("2.10.5", "2.11.6")
5+
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0")
66

7-
version in ThisBuild := buildVersion
7+
version in ThisBuild := Process("./version.sh").lines.head.trim

hashids-scala/src/main/scala/org/hashids/Hashids.scala renamed to hashids-scala/src/main/scala/org/pico/hashids/Hashids.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package org.hashids
1+
package org.pico.hashids
22

33
import scala.annotation.tailrec
4-
import org.hashids.impl._
4+
import org.pico.hashids.impl._
55

66
class Hashids(
77
salt: String = "",
@@ -14,7 +14,7 @@ class Hashids(
1414
if (numbers.isEmpty) {
1515
""
1616
} else {
17-
org.hashids.impl.encode(numbers:_*)(effectiveAlphabet, minHashLength, salt, seps, guards)
17+
org.pico.hashids.impl.encode(numbers:_*)(effectiveAlphabet, minHashLength, salt, seps, guards)
1818
}
1919
}
2020

@@ -31,13 +31,13 @@ class Hashids(
3131
result
3232
}
3333

34-
org.hashids.impl.encode(doSplit(Nil):_*)(effectiveAlphabet, minHashLength, salt, seps, guards)
34+
org.pico.hashids.impl.encode(doSplit(Nil):_*)(effectiveAlphabet, minHashLength, salt, seps, guards)
3535
}
3636

3737
def decode(hash: String): List[Long] = hash match {
3838
case "" => Nil
3939
case x =>
40-
val res = org.hashids.impl.decode(x)(effectiveAlphabet, salt, seps, guards)
40+
val res = org.pico.hashids.impl.decode(x)(effectiveAlphabet, salt, seps, guards)
4141

4242
if (res.exists(_ < 0)) {
4343
List.empty

hashids-scala/src/main/scala/org/hashids/impl/package.scala renamed to hashids-scala/src/main/scala/org/pico/hashids/impl/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.hashids
1+
package org.pico.hashids
22

33
import scala.annotation.tailrec
44

hashids-scala/src/main/scala/org/hashids/syntax/package.scala renamed to hashids-scala/src/main/scala/org/pico/hashids/syntax/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.hashids
1+
package org.pico.hashids
22

33
package object syntax {
44
implicit class HashidsLongOps(x: Long) {

hashids-scala/src/test/scala/org/hashids/CheckHashids.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package org.hashids
1+
package org.pico.hashids
22

3-
import org.hashids.syntax._
3+
import org.pico.hashids.syntax._
44
import org.scalacheck.{Arbitrary, Gen}
55
import org.specs2.ScalaCheck
66
import org.specs2.mutable.Specification

hashids-scala/src/test/scala/org/hashids/SpecHashids.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package org.hashids
1+
package org.pico.hashids
22

3-
import org.hashids.syntax._
3+
import org.pico.hashids.syntax._
44
import org.scalacheck.Gen
55
import org.specs2.ScalaCheck
66
import org.specs2.mutable._

project/Build.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import sbt._
22
import Keys._
33

4-
object Build extends Build with Version {
5-
val specs2_core = "org.specs2" %% "specs2-core" % "3.6.2"
6-
val specs2_scalacheck = "org.specs2" %% "specs2-scalacheck" % "3.6.2"
7-
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.12.4"
4+
object Build extends sbt.Build {
5+
val specs2_core = "org.specs2" %% "specs2-core" % "3.8.8"
6+
val specs2_scalacheck = "org.specs2" %% "specs2-scalacheck" % "3.8.8"
7+
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.13.4"
88

99
implicit class ProjectOps(self: Project) {
1010
def standard: Project = {

project/Version.scala

Lines changed: 0 additions & 39 deletions
This file was deleted.

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.6
1+
sbt.version=0.13.13

sbt

Lines changed: 0 additions & 15 deletions
This file was deleted.

version.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
_major_minor="$(cat version.txt | xargs)"
4+
_commits="$(git rev-list --count HEAD)"
5+
_hash="$(git rev-parse --short HEAD)"
6+
7+
if [ "${CIRCLE_PROJECT_USERNAME:-}" = "pico-works" ] && [ "${CIRCLE_BRANCH:-}" = "master" ]; then
8+
echo "$_major_minor.$_commits"
9+
else
10+
echo "$_major_minor.$_commits-$_hash"
11+
fi

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.4

0 commit comments

Comments
 (0)