These are chat archives for scala-android/sbt-android

10th
Mar 2017
Gregg Hernandez
@gregghz
Mar 10 2017 22:48
I recently transitioned from gradle to sbt using the sbt-android-gradle (or whatever it's called) plugin to generate my base sbt file. It uses libraryDependencies that look like: "com.android.support" % "support-v13" % "25.1.0" artifacts(Artifact("support-v13", "aar", "aar")) intransitive() how much of the stuff starting with artifacts is actually required? intransitive() seems optional at least
Perry
@pfn
Mar 10 2017 22:48
the problem is when the list of dependencies is retrieved from gradle, all transitives come over without being marked as such
they're all marked as intransitive to prevent any further conflicts by pulling down their dependencies
Gregg Hernandez
@gregghz
Mar 10 2017 22:49
ah, interesting
what about the artifacts(...) part?
Perry
@pfn
Mar 10 2017 22:49
the artifacts/Artifact stuff can be dropped as well, as long as only an aar artifact or packaging=aar is set for the dependency (in pom)
Gregg Hernandez
@gregghz
Mar 10 2017 22:50
cool, thanks
Perry
@pfn
Mar 10 2017 22:53
if considering migrating to sbt, I'd recommend re-writing the build, IMO the import isn't really good for building up a clean sbt build
it's more meant as a gateway-drug, get started quick from gradle
Gregg Hernandez
@gregghz
Mar 10 2017 22:54
yeah, i'm closer and closer to that every day. The current build isn't overly complicated though, just a bit of noise left over from the gradle plugin
Perry
@pfn
Mar 10 2017 22:55
especially for a simple build, rewriting it in sbt is extremely easy (dunno how complicated your build is)
Gregg Hernandez
@gregghz
Mar 10 2017 22:56
yep, the root build.sbt is only 75 lines. It actually looks like I did rewrite most of it and forgot. The dependencies are the only weird looking thing left
Perry
@pfn
Mar 10 2017 22:56
should be able to be much shorter...
unless you have lots of customizations
(not counting dependencies)
Gregg Hernandez
@gregghz
Mar 10 2017 22:56
    aaptAdditionalParams in Android ++= Nil,
    debugIncludesTests in Android := false,
    unmanagedSourceDirectories in Compile += file("./src/main/kotlin"),
    buildConfigOptions in Android ++= Nil,
    resValues in Android ++= Nil,
    proguardOptions in Android ++= Nil,
I'm guessing that kind of stuff can be left out
Perry
@pfn
Mar 10 2017 22:57
right
Gregg Hernandez
@gregghz
Mar 10 2017 22:59
[warn] Class android.support.v4.view.ScrollingView not found - continuing with a stub.
[warn] Class android.support.v4.view.NestedScrollingChild not found - continuing with a stub.
[error] Class android.support.v4.view.ScrollingView not found - continuing with a stub.
[error] Class android.support.v4.view.NestedScrollingChild not found - continuing with a stub.
What does this mean?
Perry
@pfn
Mar 10 2017 23:01
just some compiler stuff, should be able to ignore it
but sounds like support-v4 wasn't on classpath
Gregg Hernandez
@gregghz
Mar 10 2017 23:01
the build fails with 6 warnings and 3 errors that look like that
Perry
@pfn
Mar 10 2017 23:02
and it would be because support-v4 wasn't on classpath somehow
Gregg Hernandez
@gregghz
Mar 10 2017 23:04
I also get a bunch of warnings like this: [warn] com.android.support:support-compat:25.1.0:test-internal,runtime-internal,compile-internal,androidTest,test,runtime,compile is not an explicit dependency, skipping
Perry
@pfn
Mar 10 2017 23:05
probably has to do with the intransitive()
Gregg Hernandez
@gregghz
Mar 10 2017 23:05
it's gone everywhere now
[warn] Detected an ant-style project layout in scalaLib;
[warn]   this format has been deprecated in favor of modern layouts
[warn]   If this is what you want, set 'antLayoutDetector in Android := ()'
I also get this. What is "modern layouts"?
Perry
@pfn
Mar 10 2017 23:05
you can try setting transitiveAndroidLibs := true
modern = gradle style layout
if it complains about that, your project is detected as ant-style layout
Gregg Hernandez
@gregghz
Mar 10 2017 23:07
transitiveAndroidLibs fixed the build
Perry
@pfn
Mar 10 2017 23:07
it's true by default...
Gregg Hernandez
@gregghz
Mar 10 2017 23:07
ha
this is what I get for preserving the gradle plugin output
Perry
@pfn
Mar 10 2017 23:08
gradle plugin shouldn't have set transitiveAndroidLibs
not that I recall at least
Gregg Hernandez
@gregghz
Mar 10 2017 23:08
I'm sure I didn't set that (I didn't even know it existed). Either way, things are good now
Perry
@pfn
Mar 10 2017 23:09
(and verified, it's never been set in sbt-android-gradle)
Gregg Hernandez
@gregghz
Mar 10 2017 23:09
weird. Not sure how I ended up with that. Possibly a copy/paste from a random example somewhere