Skip to content

Commit

Permalink
Merge b6dffed into d7eb541
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBessai committed Feb 6, 2020
2 parents d7eb541 + b6dffed commit 674985c
Show file tree
Hide file tree
Showing 17 changed files with 459 additions and 249 deletions.
131 changes: 86 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Travis secrets
travis/local.*

# Created by https://www.gitignore.io/api/sbt,vim,java,scala,emacs,ensime,eclipse,intellij+all
# Created by https://www.gitignore.io/api/sbt,vim,java,scala,emacs,ensime,eclipse,intellij+all,bloop,metals
# Edit at https://www.gitignore.io/?templates=sbt,vim,java,scala,emacs,ensime,eclipse,intellij+all,bloop,metals

### Eclipse ###
### Bloop ###
.bloop/

### Eclipse ###
.metadata
bin/
tmp/
Expand All @@ -29,6 +30,9 @@ local.properties
# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

Expand All @@ -50,18 +54,26 @@ local.properties
# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

### Eclipse Patch ###
# Eclipse Core
# Eclipse Core
.project

# JDT-specific (Eclipse Java Development Tools)
# JDT-specific (Eclipse Java Development Tools)
.classpath

# Annotation Processing
.apt_generated

.sts4-cache/

### Emacs ###
# -*- mode: gitignore; -*-
*~
Expand Down Expand Up @@ -105,28 +117,13 @@ flycheck_*.el

# projectiles files
.projectile
projectile-bookmarks.eld

# directory configuration
.dir-locals.el

# saveplace
places

# url cache
url/cache/
# network security
/network-security.data

# cedet
ede-projects.el

# smex
smex-items

# company-statistics
company-statistics-cache.el

# anaconda-mode
anaconda-mode/

### Ensime ###
# Ensime specific
Expand All @@ -135,40 +132,53 @@ anaconda-mode/
.ensime_lucene/

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files:
# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle:
# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-debug/
cmake-build-*/

# Mongo Explorer plugin:
# Mongo Explorer plugin
.idea/**/mongoSettings.xml

## File-based project format:
# File-based project format
*.iws

## Plugin-specific files:

# IntelliJ
/out/
out/

# mpeltonen/sbt-idea plugin
.idea_modules/
Expand All @@ -179,21 +189,34 @@ atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml

# Ruby plugin and RubyMine
/.rakeTasks

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignores the whole idea folder
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### Java ###
# Compiled class file
*.class
Expand All @@ -210,6 +233,7 @@ fabric.properties
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
Expand All @@ -218,6 +242,9 @@ fabric.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Metals ###
.metals/

### SBT ###
# Simple Build Tool
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control
Expand All @@ -233,18 +260,32 @@ project/plugins/project/
.lib/

### Scala ###
*.metals

### Vim ###
# swap
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# session

# Session
Session.vim
# temporary
Sessionx.vim

# Temporary
.netrwhist
# auto-generated tag files

# Auto-generated tag files
tags

# End of https://www.gitignore.io/api/sbt,vim,java,scala,emacs,ensime,eclipse,intellij+all
# Persistent undo
[._]*.un~

# Coc configuration directory
.vim

# End of https://www.gitignore.io/api/sbt,vim,java,scala,emacs,ensime,eclipse,intellij+all,bloop,metals

project/metals.sbt
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ script: sbt +test

jobs:
include:
- stage: test
jdk: oraclejdk8
- stage: test
jdk: openjdk8
- stage: test
jdk: oraclejdk11
- stage: test
jdk: openjdk11
script: sbt clean coverage +test && sbt coverageReport coveralls
- stage: deploy
jdk: openjdk8
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
### Version 0.2.4
- Release for Scala 2.13.1.
- CI now tests and deploys with OpenJDK11

### Version 0.2.3
- eliminates a potential space leak

### Version 0.2.2
This version is a maintenence release
- moves things to org.combinators
- updates libraries
- fixes potential wrap arounds due to usage of Int in Finite

### Version 0.2.3
- eliminates a potential space leak

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The current release is available at maven central, just add
```scala
libraryDependencies += "org.combinators" %% "shapeless-feat" % "VERSIONNUMBER"
```
Currently, Scala 2.11 and 2.12 are supported in the released version.
Currently, Scala 2.11, 2.12, and 2.13 are supported in the released version.

## Examples
Can be found in the [examples project](https://github.com/combinators/shapeless-feat/tree/master/examples/src/main/scala) and the [tests](https://github.com/combinators/shapeless-feat/tree/master/src/test/scala/shapeless/feat).
Expand Down
18 changes: 13 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import sbt.{Credentials, Developer, ScmInfo}
lazy val commonSettings = Seq(
organization := "org.combinators",

scalaVersion := "2.12.4",
crossScalaVersions := Seq("2.11.12", scalaVersion.value),
scalaVersion := "2.13.1",
crossScalaVersions := Seq("2.11.12", "2.12.10", scalaVersion.value),

resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
),

headerLicense := Some(HeaderLicense.ALv2("2018", "Jan Bessai")),
headerLicense := Some(HeaderLicense.ALv2("2018-2020", "Jan Bessai")),

scalacOptions ++= Seq(
"-unchecked",
Expand All @@ -28,8 +28,16 @@ lazy val root = Project(id = "shapeless-feat", base = file(".")).
settings(
moduleName := "shapeless-feat",
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.3",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % "test",
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.5" % "test"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0" % "test",
libraryDependencies += "org.scalatestplus" %% "scalacheck-1-14" % "3.1.0.1" % "test",
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.1" % "test",
unmanagedSourceDirectories in Compile += {
val sourceDir = (sourceDirectory in Compile).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => sourceDir / "scala-2.13+"
case _ => sourceDir / "scala-2.12-"
}
}
)

lazy val examples = Project(id = "shapeless-feat-examples", base = file("examples")).
Expand Down
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.3.8
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
logLevel := Level.Warn
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.0.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0")
20 changes: 20 additions & 0 deletions src/main/scala-2.12-/shapeless/feat/VersionCompatibility.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package shapeless.feat

object VersionCompatibility {
type LazyList[+A] = scala.collection.immutable.Stream[A]
private[feat] val LazyList = new StreamCompanionAdapter

type Factory[-E, +C] = scala.collection.generic.CanBuildFrom[Nothing, E, C]
type IterableOnce[+T] = scala.collection.TraversableOnce[T]


private[feat] class StreamCompanionAdapter {
def from[E](it: IterableOnce[E]): scala.collection.immutable.Stream[E] = it.toStream
}
implicit def toStreamCompanion(adapter: StreamCompanionAdapter): scala.collection.immutable.Stream.type =
scala.collection.immutable.Stream
implicit class NewBuilderOps[E, C](factory: Factory[E, C]) {
def newBuilder: scala.collection.mutable.Builder[E, C] = factory.apply()
}

}
21 changes: 21 additions & 0 deletions src/main/scala-2.13+/shapeless/feat/VersionCompatibility.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2018-2020 Jan Bessai
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on 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.
*/

package shapeless.feat

object VersionCompatibility {
type Factory[-E, +C] = scala.collection.Factory[E, C]
}
Loading

0 comments on commit 674985c

Please sign in to comment.