Skip to content

Commit

Permalink
Update organization and packages to com.github.sbt (#89)
Browse files Browse the repository at this point in the history
* Update organization and packages to com.github.sbt

* Fix test package name

* Generate GHA scripts

* Remove bintray traces

* Update SNAPSHOT version
  • Loading branch information
RustedBones authored Sep 2, 2021
1 parent 87f5960 commit 710b9a7
Show file tree
Hide file tree
Showing 61 changed files with 146 additions and 139 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ jobs:
tar xf targets.tar
rm targets.tar
- run: sbt ++${{ matrix.scala }} ci-release
- env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ++${{ matrix.scala }} ci-release
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Copyright (c) 2012 Juan Manuel Caicedo Carvajal
All rights reserved.

Redistribution and use in source and binary forms, with or without
Redistribution and use in source and artifact forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
2. Redistributions in artifact form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add the plugin according to the [sbt documentation](https://www.scala-sbt.org/1.
For instance, add the following lines to `project/plugins.sbt`:

```
addSbtPlugin("com.cavorite" % "sbt-avro" % "3.1.0")
addSbtPlugin("com.github.sbt" % "sbt-avro" % "3.2.0")
// Java sources compiled with one version of Avro might be incompatible with a
// different version of the Avro library. Therefore we specify the compiler
Expand Down
19 changes: 11 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ThisBuild / dynverSonatypeSnapshots := true
ThisBuild / version := {
val orig = (ThisBuild / version).value
if (orig.endsWith("-SNAPSHOT")) "3.1.1-SNAPSHOT"
if (orig.endsWith("-SNAPSHOT")) "3.2.0-SNAPSHOT"
else orig
}

Expand All @@ -13,13 +13,21 @@ ThisBuild / githubWorkflowBuild := Seq(
ThisBuild / githubWorkflowTargetBranches := Seq("master")
ThisBuild / githubWorkflowJavaVersions := Seq("1.8", "1.11")
ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("ci-release")))
ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(
commands = List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
))

lazy val `sbt-avro`: Project = project
.in(file("."))
.enablePlugins(SbtPlugin)
.settings(
organization := "com.cavorite",
organization := "com.github.sbt",
description := "Sbt plugin for compiling Avro sources",
homepage := Some(url("https://github.com/sbt/sbt-avro")),
pluginCrossBuild / sbtVersion := "1.2.8",
Expand All @@ -29,11 +37,6 @@ lazy val `sbt-avro`: Project = project
Dependencies.Test.Spec2
),
licenses += ("BSD 3-Clause", url("https://github.com/sbt/sbt-avro/blob/master/LICENSE")),
publishTo := (bintray / publishTo).value,
publishMavenStyle := false,
bintrayOrganization := Some("sbt"),
bintrayRepository := "sbt-plugin-releases",
bintrayPackage := "sbt-avro2",
scriptedLaunchOpts ++= Seq(
"-Xmx1024M",
"-Dplugin.version=" + version.value,
Expand Down
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
addSbtPlugin("org.foundweekends" %% "sbt-bintray" % "0.6.1")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.spotify.avro.mojo;
package com.github.sbt.avro.mojo;

import java.io.File;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.spotify.avro.mojo;
package com.github.sbt.avro.mojo;

import org.apache.avro.Schema;
import org.apache.avro.SchemaParseException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.spotify.avro.mojo;
package com.github.sbt.avro.mojo;

public class SchemaGenerationException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.spotify.avro.mojo;
package com.github.sbt.avro.mojo;

import org.apache.avro.Schema;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package sbtavro
package com.github.sbt.avro

import com.spotify.avro.mojo.SchemaParserBuilder
import com.github.sbt.avro.mojo.SchemaParserBuilder
import org.apache.avro.Schema

import scala.collection.JavaConverters._

case class DefaultSchemaParserBuilder(types: Iterable[Schema],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sbtavro
package com.github.sbt.avro

import java.io.File

import org.apache.avro.Protocol
import org.apache.avro.compiler.idl.Idl
import org.apache.avro.compiler.specific.SpecificCompiler
Expand All @@ -11,7 +10,7 @@ import sbt.Keys._
import sbt._
import Path.relativeTo
import CrossVersion.partialVersion
import com.spotify.avro.mojo.{AvroFileRef, SchemaParserBuilder}
import com.github.sbt.avro.mojo.{AvroFileRef, SchemaParserBuilder}
import sbt.librarymanagement.DependencyFilter

/**
Expand Down Expand Up @@ -158,7 +157,7 @@ object SbtAvro extends AutoPlugin {
}

def compileAvscs(refs: Seq[AvroFileRef], target: File, log: Logger, stringType: StringType, fieldVisibility: FieldVisibility, enableDecimalLogicalType: Boolean, useNamespace: Boolean, optionalGetters: Option[Boolean], createSetters: Boolean, builder: SchemaParserBuilder) = {
import com.spotify.avro.mojo._
import com.github.sbt.avro.mojo._

import scala.collection.JavaConverters._
val compiler = new AvscFilesCompiler(builder)
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/avscparser/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ libraryDependencies ++= Seq(
avroSchemaParserBuilder := AnnotateWithArtifactSchemaParser
.newBuilder(projectID.value)
.copy(
types = singletonMap("B", Schema.createEnum("B", null, "com.cavorite.test.avscparser", singletonList("B1"))
types = singletonMap("B", Schema.createEnum("B", null, "com.github.sbt.avro.test", singletonList("B1"))
))
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.spotify.avro.mojo.SchemaParserBuilder
import com.github.sbt.avro.mojo.SchemaParserBuilder
import org.apache.avro.Schema
import sbt.ModuleID

Expand All @@ -12,7 +12,7 @@ class AnnotateWithArtifactSchemaParser(
override def parse(file: java.io.File): org.apache.avro.Schema = {
val schema = super.parse(file)
if (schema.getType == org.apache.avro.Schema.Type.RECORD) {
schema.addProp("com.cavorite.sbt-avro.artifact", moduleID.toString())
schema.addProp("com.github.sbt.sbt-avro.artifact", moduleID.toString())
}
schema
}
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/avscparser/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.cavorite" % "sbt-avro" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-avro" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/avscparser/src/main/avro/a.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "A",
"namespace": "com.cavorite.test.avscparser",
"namespace": "com.github.sbt.avro.test",
"type": "record",
"fields": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package sbtavro
package com.github.sbt.avro.test

import java.io.File

import org.apache.avro.Schema
import org.apache.avro.generic.GenericData.StringType
import org.specs2.mutable.Specification

import com.cavorite.test.avscparser.A
import com.github.sbt.avro.test.A

class AvscParserSpec extends Specification {

"A should have artifact property" >> {
A.getClassSchema().getProp("com.cavorite.sbt-avro.artifact") == "avscparser-test:avscparser-test:0.1.0-SNAPSHOT"
A.getClassSchema().getProp("com.github.sbt.sbt-avro.artifact") == "avscparser-test:avscparser-test:0.1.0-SNAPSHOT"
}

}
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-avro/avscparser/test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> compile

$ exists target/scala-2.13/src_managed/main/compiled_avro/com/cavorite/test/avscparser/A.java
$ exists target/scala-2.13/src_managed/main/compiled_avro/com/cavorite/test/avscparser/B.java
$ exists target/scala-2.13/src_managed/main/compiled_avro/com/github/sbt/avro/test/A.java
$ exists target/scala-2.13/src_managed/main/compiled_avro/com/github/sbt/avro/test/B.java

> test

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.cavorite" % "sbt-avro" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-avro" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/_a.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "_A",
"doc": "Top-level schema testing simple dependent schema names",
"fields": [{
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/_b.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "_B",
"doc": "Simple dependency",
"fields": [{
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/_c.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "_C",
"doc": "Simple dependency",
"fields": [{
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/_d.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "_D",
"doc": "Simple dependency",
"fields": [{
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/_e.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "enum",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "_E",
"doc": "Simple dependency",
"symbols" : ["X", "XX", "XXX"]
Expand Down
10 changes: 5 additions & 5 deletions src/sbt-test/sbt-avro/basic_1.10/src/main/avro/a.avsc
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "A",
"doc": "Top-level schema testing fully-qualified dependent schema names",
"fields": [{
"doc": "fully-qualified dependent union field",
"name": "b",
"type": ["null", "com.cavorite.B"]
"type": ["null", "com.github.sbt.avro.test.B"]
},{
"doc": "fully-qualified dependent record field",
"name": "c",
"type": "com.cavorite.C"
"type": "com.github.sbt.avro.test.C"
},{
"doc": "fully-qualified dependent array field",
"name": "d",
"type": {
"type": "array",
"items": "com.cavorite.D"
"items": "com.github.sbt.avro.test.D"
}
},{
"doc": "fully-qualified dependent enum field",
"name": "e",
"type": {
"type": "array",
"items": "com.cavorite.E"
"items": "com.github.sbt.avro.test.E"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-avro/basic_1.10/src/main/avro/b.avsc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "B",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "c",
"type": "com.cavorite.C"
"type": "com.github.sbt.avro.test.C"
}
]
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/c.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"name": "com.cavorite.C",
"name": "com.github.sbt.avro.test.C",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "str",
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-avro/basic_1.10/src/main/avro/d.avsc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"type": "record",
"name": "com.cavorite.D",
"name": "com.github.sbt.avro.test.D",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "c",
"type": "com.cavorite.C"
"type": "com.github.sbt.avro.test.C"
}
]
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/e.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "enum",
"doc": "Fully-qualified dependency",
"name": "com.cavorite.E",
"name": "com.github.sbt.avro.test.E",
"symbols" : ["A", "AA", "AAA"]
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/main/avro/f.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"name": "com.cavorite.F",
"name": "com.github.sbt.avro.test.F",
"doc": "Wrong default for field",
"fields": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/test/avro/x.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"name": "com.cavorite.X",
"name": "com.github.sbt.avro.test.X",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "str",
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-avro/basic_1.10/src/test/avro/y.avsc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"type": "record",
"namespace": "com.cavorite",
"namespace": "com.github.sbt.avro.test",
"name": "Y",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "x",
"type": "com.cavorite.X"
"type": "com.github.sbt.avro.test.X"
}
]
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-avro/basic_1.10/src/test/avro/z.avsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "record",
"name": "com.cavorite.Z",
"name": "com.github.sbt.avro.test.Z",
"doc": "Fully-qualified dependency",
"fields": [{
"name": "str",
Expand Down
Loading

0 comments on commit 710b9a7

Please sign in to comment.