How do I use the same package branch in all dependencies? - swift-package-manager

We get an error when resolving our swift package:
error: packageC is required using two different revision-based requirements (feature1 and development), which is not supported
Our dependency tree looks like:
Package A
├ Package B
│ └ Package C
└ Package C
In the Package.swift manifest of PackageA we have a dependency to PackageC's branch feature1.
In the Package.swift manifest of PackageB we also have a dependency to PackageC. But this time to branch development.
The Question:
Is there a way to have all PackageC's use the specified branch in specified in PackageA's manifest? (Besides manually specifying it in all the dependencies manifests)

I got around the problem by setting environment variables that all the manifest reads their required branch names from.
ProcessInfo.processInfo.environment["package_branch"]

Related

How can I build a fat jar to build my Chisel code with sbt-assembly?

I would like to build a fat JAR that can build my Chisel code. I have built these previously using Maven assembly:
https://github.com/hutch31/ChiselCodeGenerator
But I would like to get this working with chisel 3.5 and sbt-assembly, which I have done this branch:
https://github.com/hutch31/ChiselCodeGenerator/tree/chisel3.5
Per the docs I simply add the dependency and go, but it's unable to resolve the dependency when I do so:
not found: /home/guy/.ivy2/localcom.eed3si9n/sbt-assembly/scala_2.13/sbt_1.0/1.2.0/ivys/ivy.xml
not found: https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly_2.13_1.0/1.2.0/sbt-assembly-1.2.0.pom
(ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.13:1.2.0

Unable to do flow test in corda

When trying to perform to perform flow test using intellij IDE V2019.2 test fails and show the following error
command line is too long. shorten command line
Then tried to change other options in shorten command line and retested.
Then it shows java.lang.IllegalArgumentException: There are no CorDapps containing the package com.kba.flows on the classpath. Make sure the package name is correct and that the CorDapp is added as a gradle dependency.
The "IllegalArgumentException" error is thrown when the CorDapps is not present in the classpath. See below -
when (jars.size) {
0 -> throw IllegalArgumentException("There are no CorDapps containing the package $scanPackage on the classpath. Make sure " +
"the package name is correct and that the CorDapp is added as a gradle dependency.")
Please check if the CorDapp jar is present in the classpath.

Warning: Package xxxxx does not have POMDPSimulators in its dependencies in Julia if usual recommendations don't work.

I have seen this issue commonly since I started the transition to Julia v0.7 from v0.6. I am getting the following warning:
Warning: Package xxxxx does not have POMDPSimulators in its dependencies:
│ - If you have xxxxx checked out for development and have
│ added POMDPSimulators as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with xxxxx
└ Loading POMDPSimulators into xxxxx from project dependency, future warnings for xxxxx are suppressed.
I do not understand why I get this warning. In one of my files, I do: using POMDPSimulators. Since I typed in that, I have done a resolve in the Pkg manager, and done a build POMDPSimulators in the package manager. This doesn't change the warning. How can I get rid of this warning?
Note: xxxxx is just the name of a file/project that is removed to make this post general.
Note: I asked a similar question here: [Julia ERROR: LoadError: ArgumentError: Package xxxx does not have ExcelReaders in its dependencies:
I already checked out the Julia documentation and did what it says. I added the package to the project by using the package manager and typing add POMDPSimulators.
Any suggestions to resolve this issue?
Note: If possible, I am looking for a general answer since I think I am going to have this issue with other packages as well. If there is any other documentation out there besides what was provided by JuliaLang I could appreciate that since I didn't find it helpful.
Link to the Julia Article about dependencies
I tried a pkg> update, build, and resolve. The issue isn't resolved. I see the file in my Manifest and Project file.
Here is what got the Warning to no longer show for me.
Go to your require file and type "NameOfPackageGivingWarning" on a new line.
Click "]" in Julia to open the package manager in Julia command line version:
up NameOfPackageGivingWarning
build NameOfPackageGivingWarning
resolve
activate NameOfPackageGivingWarning
This should resolve the issue for you. I am honestly unsure why this works and I may be taking more steps than necessary, but it resolved the issue for all of my package dependency warnings!

getting an error with play.Project.playJavaSettings

I have a Java project using play framework v2.3. I have the following line in the build.sbt file:
play.Project.playJavaSettings
However, now that I start activator, I get the following error:
[info] Loading project definition from /home/username/typesafe/testProj/project
/home/username/typesafe/testProj/build.sbt:60: error: object Project is not a member of package play
play.Project.playJavaSettings
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
I have tried the following but I was not able to resolve the build file loading issue
playJavaSettings
Removing the line works. I am still looking into if this line really is required for a Java project or not.
playJavaSettings is not available anymore in Play 2.3, since Play is now added via the auto plug mechanism. Check the migration guide for 2.3 which states that:
Play itself is now added using the auto plugin mechanism. The
mechanism used in Play 2.2 where playJavaSettings and
playScalaSettings were used has been removed. You now use one of the
following instead
lazy val root = (project in file(".")).enablePlugins(PlayJava)

How to add scalax.io as dependency in SBT?

I want to use scalax.io._ to manipulate file operations with SBT.
When I ran it, I got the error message showing scalax is not found.
>sbt run
import scalax.io._
[error] ^
[error] iotest.scala:49: not found: object scalax
How to find the library dependency for this particular one?
A more general question, how to obtain the library dependency information for any library?
For example, if I need use actor in scala, I need specify a library dependency. How to find the library dependency?
"the library dependency information for any library" is part of the library's documentation and the author(s) is supposed to publish the info for different project management tools, sbt including. After all, what would be the purpose of developing a library that's hard to use?
Use http://search.maven.org/ to search for a library, and when you search for scala-io you'll get a list of available scala-io libraries.
Since I've never worked with the library I copied the ScalaIOExample example from Scala IO Documentation to have a working example. It needs the scalax.io and scalax.file packages that are distributed as scala-io-file artifact. Searching for the artifact leads to Artifact Details For com.github.scala-incubator.io:scala-io-file_2.10:0.4.2 with information on how to use it with Scala SBT in Dependency Information section.
With this, I created the following build.sbt in a sbt project:
scalaVersion := "2.10.3"
libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.2"
It will add scala-io-file_2.10-0.4.2.jar to classpath and executing run in the project gives the following results:
$ sbt run
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/sandbox/stackoverflow/sbt-scala-io/project
[info] Set current project to sbt-scala-io (in build file:/Users/jacek/sandbox/stackoverflow/sbt-scala-io/)
[info] Running ScalaIOExample
Not interrupting system thread Thread[Keep-Alive-Timer,8,system]
Not interrupting system thread Thread[Keep-Alive-SocketCleaner,8,system]
[success] Total time: 5 s, completed Dec 31, 2013 11:16:42 PM

Resources