mirror of https://github.com/jruby-gradle/jem
Properly support gems which have a specific platform associated with them
e.g. thread_safe
This commit is contained in:
parent
767161e069
commit
b996ac73fc
|
@ -100,7 +100,8 @@ Gem::Specification.new do |s|
|
|||
s.description = ${JsonOutput.toJson(description)}
|
||||
s.homepage = "${homepage}"
|
||||
s.authors = ${JsonOutput.toJson(authors)}
|
||||
s.email = "${email}"
|
||||
s.email = ${JsonOutput.toJson(email)}
|
||||
s.platform = "${platform}"
|
||||
|
||||
s.require_paths = ${JsonOutput.toJson(requirePaths)}
|
||||
s.executables = ${JsonOutput.toJson(executables)}
|
||||
|
|
|
@ -145,7 +145,11 @@ class GemInstaller {
|
|||
|
||||
/** Extract the gemspec file from the {@code Gem} provided into the ${installDir}/specifications */
|
||||
protected void extractSpecification(File installDir, Gem gem) {
|
||||
String outputFileName = "${gem.name}-${gem.version.version}.gemspec"
|
||||
String fileName = "${gem.name}-${gem.version.version}"
|
||||
if (gem.platform != 'ruby') {
|
||||
fileName = "${fileName}-${gem.platform}"
|
||||
}
|
||||
String outputFileName = "${fileName}.gemspec"
|
||||
FileObject outputFile = fileSystemManager.resolveFile(new File(installDir, 'specifications'), outputFileName)
|
||||
|
||||
PrintWriter writer = new PrintWriter(outputFile.content.outputStream)
|
||||
|
@ -156,6 +160,9 @@ class GemInstaller {
|
|||
|
||||
protected void extractData(File installDir, FileObject dataTarGz, Gem gem) {
|
||||
String dir = "${gem.name}-${gem.version.version}"
|
||||
if (gem.platform != 'ruby') {
|
||||
dir = "${dir}-${gem.platform}"
|
||||
}
|
||||
logger.info("Extracting into ${installDir} from ${gem.name}")
|
||||
FileObject outputDir = fileSystemManager.resolveFile(new File(installDir, 'gems'), dir)
|
||||
outputDir.copyFrom(dataTarGz, new AllFileSelector())
|
||||
|
|
Loading…
Reference in New Issue