Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 21 2022 08:27
    Kopilov closed #506
  • Nov 21 2022 08:27
    Kopilov commented #506
  • Oct 28 2022 07:13
    momomo commented #7454
  • Oct 28 2022 07:12
    ShalokShalom commented #7454
  • Oct 27 2022 23:26
    OndraZizka commented #7454
  • Sep 21 2022 08:49
    ShalokShalom commented #7454
  • Sep 21 2022 08:48
    ShalokShalom commented #7454
  • Sep 21 2022 08:47
    ShalokShalom commented #7454
  • Sep 21 2022 08:46
    ShalokShalom commented #7454
  • Sep 21 2022 08:45
    momomo commented #7454
  • Sep 21 2022 08:44
    ShalokShalom commented #7454
  • Sep 21 2022 08:43
    ShalokShalom commented #7454
  • Sep 21 2022 08:20
    luolong commented #7454
  • Sep 20 2022 13:49
    ShalokShalom commented #7454
  • Sep 20 2022 13:36
    momomo commented #7454
  • Sep 20 2022 13:30
    ShalokShalom commented #7454
  • Sep 20 2022 13:18
    momomo commented #7454
  • Sep 20 2022 13:17
    momomo commented #7454
  • Sep 20 2022 12:51
    ShalokShalom commented #7454
  • Sep 20 2022 11:17
    Voiteh commented #7454
Wojciech Potiopa
@Voiteh
what kind of usecases? there are few examples on github like spring in ceylon
Pedro Lamarão
@pedrolamarao
I have found ceylon.test, and produced simples for black box testing. IDE support is very welcome! I'll upload my samples later today.
I am now trying to find some way to do white box testing with source separation.
So far, I had success only by having white box tests inside the main module.
Pedro Lamarão
@pedrolamarao
Pedro Lamarão
@pedrolamarao
I can't convince Ceylon IDE to add resource files into de module. Is this a known thing? Maybe I'm missing something?
Wojciech Potiopa
@Voiteh
I dont have any experience in white box testing. As for resources i putf
You put files in resources folder
and then you can query them
Pedro Lamarão
@pedrolamarao
Not working. When I open the .car archive, they are not inside.
Wojciech Potiopa
@Voiteh
like this
Pedro Lamarão
@pedrolamarao
The samples I'm working with use facilities which query for resources themselves.
Currently, I have samples depending on ResourceBundle and ServiceLoader.
Anyway, when I instruct Ceylon IDE to consider a certain directory as "resources", the actual files inside don't appear inside the .car module.
Maybe this is about layout: the resources I'm trying to get in are not located in the resources root.
For example "META-INF/services/some.file"
or "some/package/hierarchy/Messages.properties"
Wojciech Potiopa
@Voiteh
I'll try to look into it tomorow
Pedro Lamarão
@pedrolamarao
I'm using Ceylon IDE as instructed by the website: downloaded a vanilla Eclipse Oxygen, then installed things via release update site
Pedro Lamarão
@pedrolamarao
I've added a new sample to the project, one that I can't make work.
Supposedly, all it requires is an import maven:com.github.jnr:"jnr-ffi" "2.1.11"; statement.
Sadly, Ceylon IDE fails, saying: "cannot find module source artifact 'maven:com.github.jnr:jnr-ffi-2.1.11' "
Wojciech Potiopa
@Voiteh
@pedrolamarao as for Your issues with resources
take close look to the docs
Suppose the following code occurs in a module named
   `com.redhat.example`:

       assert (exists resource 
          = `module`.resourceByPath("file.txt"));
       print(resource.textContent());

   Then the resource named `file.text` should be placed in 
   the subdirectory `com/redhat/example/` of the resource 
   directory.
In your resources folder You must recreate fully qualified path with the name of the module so If You have module named com.redhat.example All files (resources) which will be embed into this module must be placed in resources/com/redhat/example or other resources folder included into classpath
then You can query them like
in doc above
if You query from other module You would use metamodel call
`module your.module.name`
Wojciech Potiopa
@Voiteh
@pedrolamarao as for issues with maven this is known bug. In Ceylon module resolver there is path to maven central but starts with http which is now disabled in maven central we always get 503 but You can add another repository by providing settings.xml to the project
here is settings xml which works
And then in Your Ceylon project in IDE Your project -> properties -> ceylon build -> module repositories -> Add maven repository and from file explorer select settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 <profiles>
    <profile>
        <id>central</id>
        <repositories>
            <repository>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>Maven Central</id>
                <name>Maven Central</name>
                <url>https://repo1.maven.org/maven2/</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>central</id>
                <url>http://repo1.maven.org/maven2</url>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>central</activeProfile>
</activeProfiles>
</settings>
Pedro Lamarão
@pedrolamarao
@Voiteh OK, this Maven thing looks easy, I'll try it now.
Pedro Lamarão
@pedrolamarao
OK, overriding $HOME/.m2/settings.xml convinced Ceylon to import from Maven Central.
Pedro Lamarão
@pedrolamarao
@Voiteh About resources, I made changes according with your observations, with no effect.
ResourceBundlestill can't find the required resource.
This is my setup:
Ceylon IDE > Project Properties > Ceylon Build > Build Paths > Resources = ceylon-tui/src/main/resources
Inside ceylon-tui/src/main/resources there is this subtree : peu/ceylon/tui/Messages.properties
Wait, something changed since yesterday.
The .car archive now has the resources inside and in the proper place.
Pedro Lamarão
@pedrolamarao
Ah... This resources thing disappeared.
Probably my own confusion while configuring the project in Ceylon IDE.
Wojciech Potiopa
@Voiteh
happens ;)
Pedro Lamarão
@pedrolamarao
I'll proceed with a sample native binding with JNR.
Hmmmmmmmm.
Does the module import notation for maven imports allows specifying the classifier?
Pedro Lamarão
@pedrolamarao
Yes it does!
But I think this is will simply not work out of the box.
JNR native libraries are distributed in a separate artifact.
Apparently, Ceylon considers it a separate module.
Module isolation makes it not find its own resources.
Java ecosystem is not yet prepared for module isolation.
Is there a way to hack the module system so that resources inside jffi.native are exposed to jffi?
Pedro Lamarão
@pedrolamarao
One more for the day: is there a known problem importing log4j-api ?
John Vasileff
@jvasileff
@pedrolamarao Log4j2? IIRC Log4j1 worked for me, but not sure about Log4j2.