cmark / androtext

Xtext based model-driven software development tool for prototyping Android applications
7 stars 1 forks source link

Androtext cannot be build due to unknown versions of IncQuery and Viatra2 used #13

Open svetlin opened 10 years ago

svetlin commented 10 years ago

Hi,

I am unable to build Androtext from source due to IncQuery and Viatra2 version mismatch. The namespace for IncQuery has changed starting with version 0.7 which is the oldest version hosted on the eclipse site. So org.eclipse.viatra2.emf.incquery.runtime is no longer a valid import. I had to install both the features and the plugins for 0.6.10 from the archive here: http://incquery.net/update/incquery/ However, I am still getting error messages in the hu.bme.mit.androtest.validation.ui MANIFEST.MF Bundle org.eclipse.viatra2.emf.incquery.validation.ui cannot be resolved

Which versions of IncQuery/Viatra2 should I be using and where to get them from? Any other dependencies? I'm using Eclipse Juno (actually the current Android ADT bundle) with Xtext 2.3.1 and all of the Juno modeling tools installed.

Thanks!

cmark commented 10 years ago

Hi,

Yes, the IncQuery guys released a brand new version 0.7.x with a brand new namespace (due to Eclipse migration). Unfortunately, I did not had time to migrate my project to the new version/namespace.

You can try build/use AndroText without the validation.* projects, though. If I have time, I'll migrate this from old IncQuery to the new one (or at least to the 0.6.x one), see #11.

On the ADT side, the required version is 21.x (tested and used 21.x), I did not tested AndroText with 22.x versions. ADT changes low level Android SDK related stuff (like required jars, locations, etc) between versions (at least they did it in the past between versions), but if you are able to get AndroText running with 22.x, let me know.

Best!

svetlin commented 10 years ago

Hi, Why don't you simply supply a download link to the version of IncQuery and any other dependencies required to build? I understand you are busy and you might not get around to migrate the project to new versions. I just want to run it as it is. Thanks!

cmark commented 10 years ago

Hi,

I searched for it, but did not found it until now. So here it is.

http://incquery.net/update/archive/incquery-0.4/

It contains all necessary dependency I think, I did not tried it, so if you find any problems with it, let me know.

svetlin commented 10 years ago

Replacing IncQuery 0.6.10 with IncQuery 0.4 did get rid of the name/import errors, thanks!

However, there are still errors in the *.validation projects. hu.bme.mit.androtext.validation.META_INF.MANIFEST.mf gives errors on Export-Package: Package 'patternbuilders.androtext' does not exist in this plug-in Package 'patternmatchers.androtext' does not exist in this plug-in Package 'signatures.androtext' does not exist in this plug-in

Also, there are errors in the hu.bme.mit.androtext.validation.ui where the missing packages are referenced, e.g. import patternmatchers.androtext.BaseGameActivityCameraWarningMatcher

Is this easy to fix?

cmark commented 10 years ago

Yes, you need to generate the validation code by yourself. There is a few examples which are related to another Andro* project, called AndroGame, these are leftovers from project separation. On this weekend I'll have time to clean up this repoository a little bit, maybe bump the IncQuery to the new version.

In the meantime you can pull the new version from the repo, I removed these validation constraints for you.

Now you need to generate the validation constraints from scratch, because old IncQuery does not supports automatic generation.

Find the generator.incquery file, and right click -> EMF-IncQuery -> Some generation Action should be here, I don't remember the name. This generates the missing code into src-gen folder.

After this your projects should be fine.

svetlin commented 10 years ago

The option "Generate EMF-IncQuery source code" gives an error:

An error occurred during EMF-IncQuery code generation. 
 Error message: Could not resolve to EStructuralFeature: nemf.packages.androTextDsl.BaseGameActivity.size
 Error class: java.lang.IllegalArgumentException
     (see Error Log for further details.)
Could not resolve to EStructuralFeature: nemf.packages.androTextDsl.BaseGameActivity.size

The other options are: "Generate Sample UI project for EMF-IncQuery" "Load/Reload referenced EMF Gen Models into EMF-IncQuery project" "Generate Sample Validation project for EMF-IncQuery"

Which one of those is it?

Yes, if you've got some time to bring IncQuery up to 0.7 it would be good...

cmark commented 10 years ago

Unfortunately, I did not had time to do the IncQuery 0.7 bump. I'll try to do it as soon as possible.

Try Load/Reload reference EMF Gen Models first, and then code generation. The incquery genmodel contains references to old model elements, so that's why you've got the error message.

svetlin commented 10 years ago

I did try both steps and I am getting:

An error occurred during EMF-IncQuery code generation. 
 Error message: null
 Error class: java.lang.NullPointerException
     (see Error Log for further details.)
java.lang.NullPointerException
eclipse.buildId=v22.0.5-757759
java.version=1.7.0_13
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product com.android.ide.eclipse.adt.package.product -keyring /Users/sstanchev/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product com.android.ide.eclipse.adt.package.product -keyring /Users/sstanchev/.eclipse_keyring -showlocation

Error
Tue Oct 22 12:17:44 PDT 2013
An error occurred during EMF-IncQuery code generation.
 Error message: null
 Error class: java.lang.NullPointerException
     (see Error Log for further details.)

java.lang.NullPointerException
    at org.eclipse.viatra2.emf.incquery.runtime.extensibility.EMFPatternMatcherContext.binaryEdgeTargetType(EMFPatternMatcherContext.java:137)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.basicenumerables.TypeBinary.getTypeInfo(TypeBinary.java:60)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.helpers.LayoutHelper.eliminateInferrableUnaryTypes(LayoutHelper.java:75)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.basiclinear.BasicLinearLayout.layout(BasicLinearLayout.java:58)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.simple.PatternScaffold.run(PatternScaffold.java:71)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.simple.SimpleReteBuilder.construct(SimpleReteBuilder.java:81)
    at org.eclipse.viatra2.gtasm.patternmatcher.incremental.simple.SimpleReteBuilder.construct(SimpleReteBuilder.java:1)
    at org.eclipse.viatra2.emf.incquery.core.codegen.internal.PatternBuilderSourceGenerator.generatePatternBuilders(PatternBuilderSourceGenerator.java:119)
    at org.eclipse.viatra2.emf.incquery.core.codegen.ProjectGenerator.buildAfterClean(ProjectGenerator.java:84)
    at org.eclipse.viatra2.emf.incquery.core.codegen.ProjectGenerator.fullBuild(ProjectGenerator.java:62)
    at org.eclipse.viatra2.emf.incquery.gui.handlers.GenerateSourceCodeHandler$CodeGenerationJob.runInWorkspace(GenerateSourceCodeHandler.java:76)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

I am also seeing these errors in the error log:

Error
Tue Oct 22 12:15:47 PDT 2013
Failed finding RepositoryMapping

org.eclipse.core.internal.resources.ResourceException: Resource '/hu.bme.mit.androtext.validation/src-gen/patternbuilders/androtext' is not local.
    at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
    at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
    at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
    at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:365)
    at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:260)
    at org.eclipse.egit.core.internal.indexdiff.GitResourceDeltaVisitor.visit(GitResourceDeltaVisitor.java:72)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$6.resourceChanged(IndexDiffCacheEntry.java:456)
    at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
    at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:156)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

and

Error
Tue Oct 22 12:15:47 PDT 2013
Failed finding RepositoryMapping

org.eclipse.core.internal.resources.ResourceException: Resource '/hu.bme.mit.androtext.validation/src-gen/patternbuilders' is not local.
    at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
    at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
    at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
    at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:365)
    at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:260)
    at org.eclipse.egit.core.internal.indexdiff.GitResourceDeltaVisitor.visit(GitResourceDeltaVisitor.java:72)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:69)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:80)
    at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
    at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$6.resourceChanged(IndexDiffCacheEntry.java:456)
    at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
    at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:156)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What should I do next? Thanks!