In chrome, I have enabled source map, and I build my project like this:
haxelib run lime build "project.xml" html5 -debug -Dsource-map-content -Dwebgl
I've noticed that project.js.map is created, and haxe folder in debug folder has all hx files, however in the browser, I can see only the project.js file.
Any idea?
Related
I am trying to build a standalone application through which I can run Rust Clippy without needing to install it locally. Essentially, I want to run a command like cargo-clippy -- --message-format=json through my application when a Rust project is uploaded to it.
What I've tried:
I installed cargo locally using the instructions here
I forked the Clippy repo locally into a folder called clippy_local
I ran cargo build on the repo which created some exe binary files including cargo-clippy under clippy_local/target/debug/ (contents of the target folder attached in screenshot below)
I copied this cargo-clippy exe into the tool binaries folder for my application
After this, the project compiles, but when I try to run Clippy through my tool, I get an error like below:
dyld[14510]: Library not loaded: '#rpath/librustc_driver-6ca1b5240144bf0b.dylib'
Referenced from: '/Users/<redacted>/repos/<redacted>/target/webapp/WEB-INF/classes/tools/clippy/cargo-clippy'
Reason: tried: '/usr/local/lib/librustc_driver-6ca1b5240144bf0b.dylib' (no such file), '/usr/lib/librustc_driver-6ca1b5240144bf0b.dylib' (no such file)
My app is running the following command internally to invoke Clippy:
/Users/<redacted>/repos/<redacted>/target/webapp/WEB-INF/classes/tools/clippy/cargo-clippy -- --message-format=json
I was guessing from the error that it has something to do with missing libraries/dependencies (apart from the cargo-clippy exe). I have tried to copy all the contents of the target/debug folder into my app as well, but the same error still persists.
So, I want to know what's going wrong and how I can build a Rust Clippy binary which I can then use to run Clippy from other applications?
I was using npm run build to build my page for production, and I check the /build folder the source code doesn't exists. But when I host the host the website via IIS or httpd and use the browser to open the page, I found the source code is in there! That means anyone can grab my code and build their own website? Wired.
In your build directory, you'll see some .map files. Those are source maps, and they contain all the data necessary to rebuild things in the way you see files on-disk, even though everything is bundled for the browser.
These are useful development tools. They allow you to set breakpoints. You can even see code from other languages that was transpiled.
You should disable sourcemaps for your production builds.
I'm facing a challenge with my app from playstore. My app has the .so files which are in jniLibs folder for different ABIs. My app works well during testing but when I download from play store, logs show that lib/arm/.so file or folder is missing. However, when I download the universal apk directly from my console, it works and it has the 4 abi folders each with my .so file.
I don't know why the apk generated for delivery lacks the lib folder. If anyone knows the solution, please tell me. I have made several updates but nothing seems to work. I unzipped the app I downloaded from play store and found out that it didn't have the lib folder inside.
I've been trying to include .so files in a library module using android studio, but unable to to do so and getting java.lang.UnsatisfiedLinkError.
I've also unzipped and checked the apk generated from App Module (which depends upon my library module containing .so files), it does contains all the required .so files in it, but still i get the java.lang.UnsatisfiedLinkError
I've also tried all the other solutions present on existing threads like converting .so files to jar and then adding as dependency, adding .so files to jniLibs folder, converting library module to jar and adding jar dependency to app-module etc but no result?
p.s I'm using android studio 2.0 with gradle plugin version 2.0
You can try the following project structure. It worked for me with nothing the gradle.
> project/
libs/
fm.jar, etc. // <-- .jar files go here
src/
main/
java/
(your java files)
jniLibs/
arm64-v8a/
libopus.so, etc. // <-- .so files for ARM 64-bit go here
armeabi-v7a/
libopus.so, etc. // <-- .so files for ARM 32-bit go here
x86/
libopus.so, etc. // <-- .so files for Intel 32-bit go here
res/
(your drawables/layouts/values)
I was using ANT before (Android Project) and i had "static" files in the same packages as my code
Here is an example
src/com/my/app/test/Parser.java
src/com/my/app/test/json_to_parse.json
When executing the unit tests, the json file was copied into the gen folder, therfor it was possible to access the json in the test with
getClass().getResourceAsStream(fileName)
I had to convert the project to gradle, but now the tests are failing.
After checking the "build" folder, i've realised, the .json files are not there, therefor the getResourceAsStream method returns null.
Any idea how to include these "static" files (json, xml, ...) into the build folder?
Moving the files into the resources folder did not work out of the box in Android Studio (even though is should have)
This should be fixed in Android Studio 1.2.
However, this is what i did:
Moved all static files into the resources folder.
In my unit-test module i've added this to the build.gradle file
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources
Now, all files located inside src/test/resources will be copied into /classes/test where i can access them with
getClass().getResourceAsStream(fileName)
If i keep the package structure inside the resources folder the same as it was in the java folder, i don't need to adjust any code.
To complete the story a bit more:
JUnit4 runner requires
getClass().getResourceAsStream(name)
while Robolectric requires
getClass().getClassLoader().getResourceAsStream(name)
The files you are asking about are called "resource files" in Maven/Gradle lingo.
Gradle assumes that you are using the Maven Standard Directory Layout.
So, either you move your files into src/test/resources (then Gradle will pick them up automatically), or you tell Gradle that it should look for resources in some other place.
In the latter case, you need to modify the processTestResources task. However, keeping resource files in the same directory as source code is a bad practice. So I advise the former option.
if your problem is happen when you create apk with AndroidStudio.
you can create a jar file that includes your resources with jar.exe
for example i put a.txt into resources directory
and run this code in cmd:
"C:\Program Files\Java\jdk1.7.0_79\bin\jar" cvfe res.jar -c resources
after that a jar file "res.jar" was created
then add that res.jar into libs folder in your project
when your apk is creating resources are added to your final apk and you can use this code to acsess a.txt:
someclass.class.getClassLoader().getResourceAsStream("resources/a.txt");
with this job no need to change Gradle setting.