Gradle 1.3: build.gradle not building classes - linux

a newb question here: I have a build.gradle file with apply plugin: java in it, and associated with a java project/package. when I run gradle build from the command line I get:
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
BUILD SUCCESSFUL
Total time: 4.312 secs
but when I check the build folder, there are no classes. What am I doing wrong ?
I have:
lib, reports, test-results & tmp under the folder but no classes. The src code is a class with a main method with 'Hello world' printed to console...
My tree looks like this:
.
├── build
│   ├── libs
│   │   └── gradle-sandbox.jar
│   ├── reports
│   │   └── tests
│   │   ├── base-style.css
│   │   ├── css3-pie-1.0beta3.htc
│   │   ├── index.html
│   │   ├── report.js
│   │   └── style.css
│   ├── test-results
│   └── tmp
│   └── jar
│   └── MANIFEST.MF
├── build.gradle
└── src
└── org
└── gradle
└── example
└── simple
├── HelloWorld.java
└── package-info.java

Without more information, it's hard to say. Maybe you put the source file into the wrong directory (default is src/main/java). Or the internal caches got corrupted (shouldn't happen, but try to delete the .gradle directory).
Do you get class files when you do gradle clean build? Note that a clean build is required whenever you switch between Gradle versions.

I had a similar issue where all of my classes were in src/main/java but none of the classes were showing up in the jar.
Issue was I was using Groovy. Adjusting it to src/main/groovy resolved the issue.

I had similar issue where I was already following the above hierarchy but also putted build.gradle inside the srcm/main/java/{{my project}}. Moving build.gradle to the project's root directory worked for me.
Let me know if it'll work for anyone else.

Related

geopandas read shp file with fiona.errors.DriverError when wrapping up as a package

I have a package structure like this:
├── LICENSE
├── README.md
├── main
│   ├── __init__.py
│   ├── application.py
│   ├── core_function
│   │   ├── __init__.py
│   │   └── maps
│   │   ├── Taiwan
│   │   ├── Taiwan_detailed
│   │   └── taiwan.txt
└── setup.py
I try to wrap this package by python setup.py develop.
When it runs Taiwan = gpd.read_file(pkg_resources.resource_stream(__name__, 'maps/Taiwan/COUNTY_MOI_1090820.shp')) in application.py,
fiona.errors.DriverError: '/vsimem/9b633f8a8a3f457eadf710539afd2a22' not recognized as a supported file format. or
fiona._err.CPLE_OpenFailedError: '/vsimem/9b633f8a8a3f457eadf710539afd2a22' not recognized as a supported file format. would occur.
It reads perfectly when I run it as a script on my machine, but it fails as a package.
Knowing that the shp file should be read along with all the files in that folder, in my setup.py I also include them
packages= setuptools.find_packages(),
package_data={'maps': ['main/core_function/maps/*','core_function/maps/Taiwan/*']},
I was thinking the problem is about the path, but taiwan.txt can be read.
Any suggestion is appreciated. Thanks in advance.
So far I have not found the reason.
But I instead used the to_file method and work with only one file.
.to_file("package.gpkg", driver="GPKG")
This works in my package. The problem can be due to reading multiple files.

Existing .so and .h files integration in android studio

I have one shared library and one header file.
I did one sample project there I have generated .so and header files but now my problem is how to import existing .so and .h files in android studio.
I searched in google but there they are showing how to generate but I want how to import these files. Please suggest me some links or any other examples
but now my problem is how to import existing .so and .h files in android studio
Usually, you should put your .so files inside jniLibs which is usually located at app/src/main/jniLibs, and put c/c++ source code inside app/src/main/cpp. See below directory structure.
.
├── CMakeLists.txt // Your cmake configuration files.
├── app.iml
├── build
├── build.gradle
├── libs
├── proguard-rules.pro
└── src
├── androidTest
│ └── java
├── main
│ ├── AndroidManifest.xml
│ ├── cpp // Directory to put your jni native source code.
│ │ └── native-lib.cpp
│ ├── java
│ ├── jniLibs // Directory to put your jni libs, i.e. the .so files.
│ └── res
└── test
└── java
See: https://stackoverflow.com/a/52048933/8034839

Can I swap out the library used by a binary with a wrapper when building a third-party crate?

Let's say there is a vendored third-party cargo project consisting of a library plem and a binary plem_main that I want to extend with some functionality of my own. Crucially, the functionality needs to go in the library plem, not the binary plem_main (which can stay the same). I could write a wrapper my_plem around the library that offers the same interface to the binary, but with the extra functionality included. The project would be set up like this:
.
├── Cargo.toml
├── my_plem
│   ├── Cargo.toml
│   └── src
│   └── lib.rs
└── third-party
├── plem
│   ├── Cargo.toml
│   └── src
│   └── lib.rs
└── plem_main
├── Cargo.toml
└── src
└── main.rs
my_plem/src/lib.rs would depend on things in third-party/plem/src/lib.rs and reexport or overwrite the functions exported by the latter. Is there a good way to get cargo to build the binary plem_main on top of my_plem instead of plem?
"Best" here means that the solution has no or minimal merge conflicts when updating plem in my project and doesn't duplicate the code of plem_main. Ideally it does not touch third-party at all.

Updating the script present in Poky Source code

meta/recipes-core/initrdscripts/files/init-install-efi.sh is used for formatting and creating partitions.
I have modified this file to create one more partition for software update.
Can I copy the newly updated script file in my own custom layer recipes-core/initrdscripts/files/init-install-efi.sh.
Will it update the init-install-efi.sh. If not how to achieve this, I don't want to touch the poky source code, as that is fetched using repo utility
$ tree meta-ncr/
meta-ncr/
├── conf
│   ├── bblayers.conf
│   ├── layer.conf
│   └── machine
│   └── panther2.conf
├── recipes-core
│   └── initrdscripts
│   ├── files
│   │   └── init-install-efi.sh
│   └── initramfs-live-install-efi_1.0.bbappend
└── scripts
└── setup-environment
$ cat meta-ncr/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI = "file://init-install-efi.sh"
After debugging, I found that it is copying the script present in the meta-intel layer and not of my layer.
This is from the output of bitbake-layers show-appends
initramfs-live-install-efi_1.0.bb:
/home/jamal/repo_test/sources/meta-intel/recipes-core/initrdscripts/initramfs-live-install-efi_%.bbappend
/home/jamal/repo_test/sources/meta-ncr/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
Can you please tell me what changes are required for my bbappend to work instead of meta-intel
Yocto provides bbappend mechanism to archive Your case without touching metadata from poky, please follow these few steps to archive this:
create new layer or use Your existing one,
in this layer create bbappend file for initramfs-module-install-efi_1.0.bb or initramfs-live-install-efi_1.0.bb (I found that this recipes are based on this script), with content:
$ cat meta-test/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI = "file://init-install-efi.sh"
move modified script file under files directory, Your meta layer structure should look like:
$ tree meta-test/
meta-test/
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
└── initrdscripts
├── files
│   └── init-install-efi.sh
└── initramfs-live-install-efi_1.0.bbappend
4 directories, 5 files
Then finally after running do_unpack task on initramfs-live-install-efi recipe in working directory You will find Your modified file in recipe workspace,
$ bitbake -c unpack initramfs-live-install-efi
Test:
$ cat tmp/work/i586-poky-linux/initramfs-live-install-efi/1.0-r1/init-install-efi.sh
#!/bin/bash
echo "hello"
FILESEXTRAPATHS - is used to extend search path for do_fetch and do_patch tasks.

any specific example of making a dictionary using logios

I followed this tutorial trying to build a dictionary, but I think the logios package is generally used for gram and classes file given as input. If I understood it correctly, the dictionary should be built by feeding either a sample text file or a vocabulary file, there shouldn't be any gram file involved. So my questions are
A) Is my understanding about the input correct?
B) Based on above assumption, I guess the correct way of using the package is not building them all, but rather making use of a component inside Tools directory named MakeDict. But I fell short of any solid example of how to use this tool. So I tried by making modification to test_MakeDict.sh file, but it failed with no further information on which component fails. So what shall I do next? Can anyone give any solid command line examples on using this tool, and shall I build the whole package first before I can use any individual component?
The directory layout in MakeDict is as
.
├── AUTHORS
├── bin
│   ├── x86-linux
│   │   └── pronounce
│   └── x86-nt
│   ├── libgnurx-0.dll
│   └── pronounce.exe
├── dict
│   ├── command.dic
│   ├── command.txt
│   ├── command.vocab
│   ├── hand.dic
│   └── pronunciation.log
├── lextool.pl
├── lib
│   ├── lexdata
│   │   ├── lexicon.data
│   │   ├── lexicon.key
│   │   ├── ltosru.bin
│   │   ├── nslex.900
│   │   └── nslex.901
│   └── Pronounce.pm
├── logios.log
├── make_pronunciation.pl
├── README
├── test
│   ├── example
│   ├── example.dic.test
│   ├── hand.dict
│   └── pronunciation.log.test
└── test_MakeDict.sh
You have to use the pronounce executable. Depending on your OS you will have to use the linux or nt version.
You can use it as follows:
(from the MakeDict root directory)
./bin/x86-linux/pronounce -d [name of the dictionary you want to use from the dict folder] -i [words file] -o [destination dictionary]
The words file must be a file contanining the words you want to include in the dictionary, one per line.
The dictionary I used was cmudict_SPHINX_40. I don't know which one you should use.

Resources