last question for the night, I hope. anyone have a...
# gradle
x
last question for the night, I hope. anyone have any idea's about this problem? https://stackoverflow.com/q/47880167/206466
x
clever, I had thought of that
and or just shelling out to system myself
will that work if
gitClone
is part of
build
or will clone always have to be done as it's own step
g
It depends on your case. I would choose gitClone as a separate optional step, if you don’t need those repos for all cases all the time
x
well, since it seems idempotent, I wasn't worried about it
I think in this case I do
g
just because not sure how good multi-git with incremental builds
x
should be the same as any composite build?
but I'm not sure about that either
g
Yes, should be the same
We use approach with conditional include a lot as optional way to develop library together with our app
x
how do you do the conditional include? I imagine you have some way to do jar or git?
g
we just clone required repo manually to a special
ignored
dir
so don’t use gradle to manage repos for you
x
ah, so you don't have a jar that you use if the source isn't there
g
yes, we use sources
because main case: clone some library sources, include as a composite builde, change lib, [optional] change app to work with new lib version, commit lib, publish, commit app that uses new version of library
composite build just allow to develop and test library together with app, so it much faster and easy
x
exactly why I plan to do this 😉
I was just wondering because you suggested you had the option not to develop the app with the libraries
g
don’t have a jar that you use if the source isn’t there
oh, I misunderstand you, we don’t use local jar, but we have published jar as external dependency that used, if you don’t have library in your composite build
x
oh, I get it, I was having a derp thinking, but then how does the composite build work, but duh
ok, I'll go on to implementing this, which solves big headache
might convert that build to kotlin too
g
Also, we do not include git config in gradle, because each developer works in own fork of library repo, so you can clone any repo for local development
also, we use this approach to be more flexible: //settings.gradle
Copy code
if (file('local-settings.gradle').exists()) {
    // You can create file  local-settings.gradle in root dir and
    // add to this file your local modules or composite builds
    apply from: 'local-settings.gradle'
}
local-settings.gradle in .gitignore, so each developer can include any projects just put them to local-settings.gradle and do not worry about modified settings.gradle that should be under vcs control
you also can include some test modules there
x
that's cool
honestly I was looking into switching to gradle in part just because I thought composite builds were possible, and that I might be able to do main, test-lib, test
instead of just main, test
maven > gradle > gradle w/ kotlin
ugh can I stop reworking build scripts
lol
btw, do you have any better way of sharing plugin configuration amongst your composite libs, than writing a "plugin bundle"?, or copy and paste
g
sharing plugin configuration amongst your composite libs
Sharing plugin configuration?
Composite builds completely independent, you cannot share anything
but you can write own plugin that encapsulate that logic for your projects
Also, you can use script plugins, not only binary ones
x
hmm
Copy code
task("build", {
    dependsOn(gradle.includedBuild("is").task(":build"))
    dependsOn(gradle.includedBuild("sec").task(":build"))
})
so I have that in my build.gradle.kts
and when I have that but a clone hasn't been done
the gitClone is still blowing up
I'm trying to get all of the "sub projects suites" to be run
is there a better way than also protecting it with a conditional?