-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiled sub-project isn't added as dependency to root project #19
Comments
As reference this is the tree of the project folder: https://gist.github.com/hvze/41675ec80bf72e78f3bef296afe1c666
plugins {
id 'com.typelead.eta'
}
group 'fi.ill.mod'
version '0.0.1-ec40f44'
allprojects {
repositories {
mavenCentral()
}
}
sourceSets {
main {
eta {
srcDir 'eta'
}
}
}
eta {
version = '0.7.2b1'
etlasVersion = '1.3.0.0'
}
dependencies {
compile eta('base:4.8.2.0')
}
apply plugin: 'idea'
include ':eta'
findProject(':eta')?.name = 'Lambda-Haskell'
buildscript {
repositories {
jcenter()
maven { url = 'https://repo.spongepowered.org/maven' }
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "gradle.plugin.com.typelead:gradle-eta:0.6.1"
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'net.nemerosa:versioning:2.0.0'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '2.0.3'
}
apply plugin: 'eta-base'
apply plugin: 'eta'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'net.nemerosa.versioning'
// apply plugin: 'de.fuerstenau.buildconfig'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'idea'
apply plugin: 'maven'
apply from: "gradle/scripts/deps.gradle"
apply from: "gradle/scripts/tasks.gradle"
version = "0.0.1-" + versioning.info.build
group = "fi.ill.mod"
archivesBaseName = "lambda"
/* mixin {
add sourceSets.main, "mixins.lambda.refmap.json"
} */
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "1.12.2-14.23.3.2685"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
manifest {
attributes 'FMLCorePlugin': 'fi.ill.mod.ClientMod'
attributes 'FMLCorePluginContainsMod': 'true'
}
}
|
@hvze Can you try shifting:
from your dependency's build.gradle to your root project's build.gradle? The plugin should actually not allow you to configure the |
@hvze I tried reproducing your issue with a minimal project here: https://github.com/rahulmutt/java-eta-gradle And I was unable to reproduce. If you can modify that project to reproduce your problem, it'll help track this down. I have a feeling this has to do with the way you exported - maybe a typo somewhere? |
With that test project the issue still occurs, @rahulmutt When building the projects, both work fine, but in the root java project, IntelliJ has problems displaying the exported java code. This is because the compiled eta code is not shown as a dependency |
It seems if I update the Next, IntelliJ still doesn't resolve this correctly, even if I manually give the dependencies {
...
// Adding either of these doesn't seem to give IntelliJ a strong enough hint.
compile files("$userHome/dump/java-eta-gradle/eta/build/libs/HelloEta.jar")
runtime files("$userHome/dump/java-eta-gradle/eta/build/libs/HelloEta.jar")
} In order to get IntelliJ to resolve the build.gradle plugins {
id 'com.typelead.eta.base' version '0.6.1'
id 'java'
}
apply plugin: 'application'
mainClassName = 'eta.test.Hello'
def userHome = System.getProperty('user.home')
dependencies {
compile project(':HelloEta')
runtime files(
"$userHome/.etlas/lib/eta-0.7.2.1/base-4.8.2.0-IPFDtZjmEfh5tPXF10v5hF/base-4.8.2.0-IPFDtZjmEfh5tPXF10v5hF.jar",
"$userHome/.etlas/lib/eta-0.7.2.1/ghc-prim-0.4.0.0-Jhi6UgHuZdoBZWUpVo3WKE/ghc-prim-0.4.0.0-Jhi6UgHuZdoBZWUpVo3WKE.jar",
"$userHome/.etlas/lib/eta-0.7.2.1/integer-0.5.1.0-ACyqTmAMUMGGvisLFeQbAm/integer-0.5.1.0-ACyqTmAMUMGGvisLFeQbAm.jar",
"$userHome/.etlas/lib/eta-0.7.2.1/rts-0.1.0.0-5Dj4qf1Wx9cCeYbpni5T1w/rts-0.1.0.0-5Dj4qf1Wx9cCeYbpni5T1w.jar"
)
} Hello.java package eta.test;
import eta.utils.EtaExport;
public class Hello {
public static void main(String[] args) {
System.out.println(new Hello().hello());
} |
@carymrobbins Does setting Most of the plugin code just deals with adding dependencies properly and the main issue you may hit is if something needs the dependencies before the Gradle task graph is constructed & executed. In this case, |
Should be fixed in |
@hvze @carymrobbins Any luck with |
Given this file structure:
If I link B (an eta project) to A (a java project)
B isn't automatically added as a dependency when eta is finished compiling, so A fails to compile as well when referencing exported code from B.
The text was updated successfully, but these errors were encountered: