Commit b2586c6 1 parent e0238b8 commit b2586c6 Copy full SHA for b2586c6
File tree 5 files changed +35
-6
lines changed
main/scala/com/typesafe/sbt/packager/rpm
sbt-test/rpm/snapshot-override-rpm
5 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ object RpmPlugin extends AutoPlugin {
105
105
packageArchitecture in Rpm := " noarch" ,
106
106
rpmMetadata := RpmMetadata (
107
107
(packageName in Rpm ).value,
108
- if (isSnapshot.value) stripSnapshot(( version in Rpm ).value) else (version in Rpm ).value ,
108
+ ( version in Rpm ).value.stripSuffix( " -SNAPSHOT " ) ,
109
109
rpmRelease.value,
110
110
rpmPrefix.value,
111
111
(packageArchitecture in Rpm ).value,
@@ -163,11 +163,6 @@ object RpmPlugin extends AutoPlugin {
163
163
}
164
164
}
165
165
)
166
-
167
- def stripSnapshot (version : String ): String = {
168
- val suffixPosition = version.indexOf(" -SNAPSHOT" )
169
- version.slice(0 , suffixPosition)
170
- }
171
166
}
172
167
173
168
object RpmDeployPlugin extends AutoPlugin {
Original file line number Diff line number Diff line change
1
+ enablePlugins(RpmPlugin )
2
+
3
+ name := " rpm-test"
4
+
5
+ version := " 0.1.0-SNAPSHOT"
6
+
7
+ maintainer
:= " Keir Lawson <[email protected] >"
8
+
9
+ packageSummary := " Snapshot test rpm package"
10
+
11
+ packageDescription := """ A fun package description of our software,
12
+ with multiple lines."""
13
+
14
+ rpmVendor := " typesafe"
15
+
16
+ rpmUrl := Some (" http://github.com/sbt/sbt-native-packager" )
17
+
18
+ rpmLicense := Some (" BSD" )
19
+
20
+ version in Rpm := " 1"
21
+
22
+ TaskKey [Unit ](" check-snapshot" ) := {
23
+ assert(rpmRelease.value == " SNAPSHOT" , s " RPM has incorrect value ${rpmRelease.value}" )
24
+ assert(rpmMetadata.value.version == " 1" , s " RPM has incorrect value ${rpmMetadata.value.version}" )
25
+ assert((version in Rpm ).value == " 1" , s " RPM has incorrect value ${(version in Rpm ).value}" )
26
+ }
Original file line number Diff line number Diff line change
1
+ addSbtPlugin(" com.typesafe.sbt" % " sbt-native-packager" % sys.props(" project.version" ))
Original file line number Diff line number Diff line change
1
+ # Test configuration file!
Original file line number Diff line number Diff line change
1
+ # Run the debian packaging.
2
+ > rpm:package-bin
3
+ $ exists target/rpm/RPMS/noarch/rpm-test-1-SNAPSHOT.noarch.rpm
4
+
5
+ #Check release and version configured correctly
6
+ > check-snapshot
You can’t perform that action at this time.
0 commit comments