Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update osgi config #258

Merged
merged 2 commits into from
Oct 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.