Skip to content

Commit

Permalink
Merge pull request #258 from sschaef/update-osgi-config
Browse files Browse the repository at this point in the history
Update osgi config
  • Loading branch information
godenji authored Oct 29, 2017
2 parents 80867b8 + cef357a commit 4e497a9
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 115 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
target/
!scalariform.update/target/
lib_managed/
src_managed/
bin/
.history
.cache
Expand Down
2 changes: 1 addition & 1 deletion scalariform/META-INF/MANIFEST.MF → MANIFEST.MF.prototype
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Scalariform
Bundle-SymbolicName: scalariform
Bundle-Version: 0.2.5.qualifier
Bundle-Version: version.qualifier
Require-Bundle: org.scala-lang.scala-library,
org.scala-lang.modules.scala-xml
Bundle-ClassPath: .
Expand Down
23 changes: 16 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,29 @@ lazy val scalariform = (project
libraryDependencies ++= scala2_11Dependencies.value,
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test",
// sbt doesn't automatically load the content of the MANIFST.MF file, therefore
// we have to do it here by ourselves Furthermore, the version format in the
// MANIFEST.MF is `x.y.z.qualifier` but we need to replace the `qualifier` part
// with a unique identifier otherwise OSGi can't find out which nightly build
// is newest and therefore not all caches are updated with the correct version
// of a nightly.
// we have to do it here by ourselves. Furthermore, the version format in the
// MANIFEST.MF is `version.qualifier`, which means that we have to replace
// `version` by the actual version and `qualifier` with a unique identifier
// otherwise OSGi can't find out which nightly build is newest and therefore
// not all caches are updated with the correct version of a nightly.
packageOptions in Compile in packageBin += {
val m = Using.fileInputStream(file("scalariform/META-INF/MANIFEST.MF")) { in =>
val m = Using.fileInputStream(new java.io.File("MANIFEST.MF.prototype")) { in =>
val manifest = new java.util.jar.Manifest(in)
val attr = manifest.getMainAttributes
val key = "Bundle-Version"
val versionSuffix = scalaBinaryVersion.value.replace('.', '_')
// get the version but get rid of "-SNAPSHOT" suffix if it exists
val v = {
val v = version.value
val i = v.lastIndexOf('-')
if (i > 0)
v.substring(0, i)
else
v
}
val date = new java.text.SimpleDateFormat("yyyyMMddHHmm").format(new java.util.Date)
val sha = "git rev-parse --short HEAD".!!.trim
attr.putValue(key, attr.getValue(key).replace("qualifier", s"$versionSuffix-$date-$sha"))
attr.putValue(key, attr.getValue(key).replace("version.qualifier", s"$v.$versionSuffix-$date-$sha"))
manifest
}
Package.JarManifest(m)
Expand Down
1 change: 0 additions & 1 deletion scalariform.feature/build.properties

This file was deleted.

55 changes: 0 additions & 55 deletions scalariform.feature/feature.xml

This file was deleted.

13 changes: 0 additions & 13 deletions scalariform.feature/pom.xml

This file was deleted.

13 changes: 0 additions & 13 deletions scalariform.update/pom.xml

This file was deleted.

11 changes: 0 additions & 11 deletions scalariform.update/site.xml

This file was deleted.

Binary file removed scalariform.update/target/site.zip
Binary file not shown.
Binary file removed scalariform.update/target/site/artifacts.jar
Binary file not shown.
Binary file removed scalariform.update/target/site/content.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 0 additions & 11 deletions scalariform.update/target/site/site.xml

This file was deleted.

Binary file removed scalariform.update/target/site_assembly.zip
Binary file not shown.

0 comments on commit 4e497a9

Please sign in to comment.