Skip to content

Commit

Permalink
Change package name and update serialization tests (#9)
Browse files Browse the repository at this point in the history
* Moved files to new package structure
* Fix serialization tests due to change
  • Loading branch information
ekrich authored Dec 14, 2018
1 parent ab038b1 commit 72a1680
Show file tree
Hide file tree
Showing 141 changed files with 407 additions and 393 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The following changes are needed if migrating from the original Java version.
- Change the package organization name from `com.typesafe` to `org.ekrich`.
- Other code sites may require removing `()` where the method just returns state. This is to
follow the Scala convention which supports the *uniform access principle* [1].
- The serialization format has changed due to the package name change. This could
require special consideration.

The following document copies are local to this repository but internal links may refer to the
original site documents via hyperlink.
Expand Down
20 changes: 16 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,31 @@ addCommandAlias(
).mkString(";", ";", "")
)

val configVersion = "0.7.0-SNAPSHOT"
val scalacOpts = List("-unchecked", "-deprecation", "-feature")
val nextVersion = "0.7.0"
// stable snapshot is not great for publish local
def versionFmt(out: sbtdynver.GitDescribeOutput): String = {
val snap = "-SNAPSHOT"
val tag = out.ref.dropV.value
if (out.isCleanAfterTag) tag
// out.ref.value in non git project?
else nextVersion + "-" + out.ref.value + snap
}

val scalacOpts = List("-unchecked", "-deprecation", "-feature")

ThisBuild / version := configVersion
ThisBuild / Compile / scalacOptions := scalacOpts
ThisBuild / Test / scalacOptions := scalacOpts

ThisBuild / crossScalaVersions := Seq("2.12.8", "2.11.12")

inThisBuild(
List(
version := dynverGitDescribeOutput.value.mkVersion(versionFmt, ""),
dynver := sbtdynver.DynVer
.getGitDescribeOutput(new java.util.Date)
.mkVersion(versionFmt, ""),
description := "Configuration library for Scala using HOCON files",
organization := "org.ekrich", // causes package error not being com.typesafe
organization := "org.ekrich",
homepage := Some(url("https://github.com/ekrich/sconfig")),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
Expand Down
2 changes: 1 addition & 1 deletion examples/java/complex-app/src/main/java/ComplexApp.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.typesafe.config.*;
import org.ekrich.config.*;
import simplelib.*;

class ComplexApp {
Expand Down
2 changes: 1 addition & 1 deletion examples/java/simple-app/src/main/java/SimpleApp.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.typesafe.config.*;
import org.ekrich.config.*;
import simplelib.*;

class SimpleApp {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package simplelib;

import com.typesafe.config.*;
import org.ekrich.config.*;

// Whenever you write a library, allow people to supply a Config but
// also default to ConfigFactory.load if they don't supply one.
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/complex-app/src/main/scala/ComplexApp.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.typesafe.config._
import org.ekrich.config._
import simplelib._

object ComplexApp extends App {
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/simple-app/src/main/scala/SimpleApp.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.typesafe.config._
import org.ekrich.config._
import simplelib._

object SimpleApp extends App {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package simplelib

import com.typesafe.config._
import org.ekrich.config._

// Whenever you write a library, allow people to supply a Config but
// also default to ConfigFactory.load if they don't supply one.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.typesafe.config;
package org.ekrich.config;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
Expand Down
15 changes: 0 additions & 15 deletions sconfig/src/main/scala/com/typesafe/config/impl/FullIncluder.scala

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.time.Duration
import java.time.Period
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.typesafe.config
package org.ekrich.config

import com.typesafe.config.impl.ConfigBeanImpl
import org.ekrich.config.impl.ConfigBeanImpl

/**
* Factory for automatically creating a Java class from a [[Config]].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.io.{
IOException,
Expand All @@ -12,7 +12,7 @@ import java.io.{
import java.{lang => jl}
import jl.reflect.Field

import com.typesafe.config.impl.ConfigImplUtil
import org.ekrich.config.impl.ConfigImplUtil

/**
* All exceptions thrown by the library are subclasses of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import com.typesafe.config.impl.ConfigImpl
import com.typesafe.config.impl.Parseable
import org.ekrich.config.impl.ConfigImpl
import org.ekrich.config.impl.Parseable
import java.io.{File, Reader}
import java.net.URL
import java.{util => ju}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* Context provided to a {@link ConfigIncluder}; this interface is only useful
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* Implement this interface and provide an instance to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* Implement this <em>in addition to</em> {@link ConfigIncluder} if you want to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.net.URL

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.{util => ju}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.typesafe.config
package org.ekrich.config

/**
* This method allows you to alter default config loading strategy for all the code which
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* An immutable class representing an amount of memory. Use
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* Marker for types whose instances can be merged, that is [[Config]] and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.{util => ju}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.net.URL
import java.util.List
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.typesafe.config
package org.ekrich.config

import java.net.URL
import com.typesafe.config.impl.ConfigImpl
import org.ekrich.config.impl.ConfigImpl

/**
* This class contains some static factory methods for building a [[ConfigOrigin]].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import com.typesafe.config.impl.ConfigImplUtil
import org.ekrich.config.impl.ConfigImplUtil

/**
* A set of options related to parsing.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* An opaque handle to something that can be parsed, obtained from
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* A set of options related to resolving substitutions. Substitutions use the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.typesafe.config
package org.ekrich.config

/**
* Implement this interface and provide an instance to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* The syntax of a character stream (<a href="http://json.org">JSON</a>, <a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.typesafe.config
package org.ekrich.config

import java.{util => ju}

import com.typesafe.config.impl.ConfigImplUtil
import org.ekrich.config.impl.ConfigImplUtil

import scala.annotation.varargs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* An immutable value, following the <a href="http://json.org">JSON</a> type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

import java.{util => ju}
import java.{lang => jl}
import com.typesafe.config.impl.ConfigImpl
import org.ekrich.config.impl.ConfigImpl

/**
* This class holds some static factory methods for building {@link ConfigValue}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config
package org.ekrich.config

/**
* The type of a configuration value (following the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.typesafe.config
package org.ekrich.config

import java.io.File
import java.net.MalformedURLException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config.impl
package org.ekrich.config.impl

import com.typesafe.config.parser.ConfigNode
import org.ekrich.config.parser.ConfigNode
import java.{util => ju}

abstract class AbstractConfigNode extends ConfigNode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config.impl
package org.ekrich.config.impl

// This is required if we want
// to be referencing the AbstractConfigNode class in implementation rather than the
Expand Down
Loading

0 comments on commit 72a1680

Please sign in to comment.