Skip to content
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

Reviving missing build files in the android-example #1518

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9f6ebfb
Added JmeSurfaceView.java class , for embedding jme-game in a custom …
Scrappers-glitch Mar 27, 2021
a49b7b9
Removal of white spaces
Scrappers-glitch Mar 28, 2021
e302f09
Removal of white spaces
Scrappers-glitch Mar 28, 2021
25a687d
Cleaning up (formatting errors/jme copyright)
Scrappers-glitch Apr 2, 2021
a8d9341
Merge remote-tracking branch 'origin/master'
Scrappers-glitch Apr 2, 2021
016e60c
Moved the class files into an independent package
Scrappers-glitch Apr 2, 2021
2e46ada
Handled the user delay for zero & negative numbers
Scrappers-glitch Apr 2, 2021
6a4459f
Cleaning up 2
Scrappers-glitch Apr 6, 2021
b55ce25
delete unnecessary files
Scrappers-glitch Apr 9, 2021
ef93236
delete unnecessary files
Scrappers-glitch Apr 9, 2021
a9f09ed
delete unnecessary files
Scrappers-glitch Apr 9, 2021
b822b37
delete unnecessary files
Scrappers-glitch Apr 9, 2021
b24489a
delete unnecessary files
Scrappers-glitch Apr 9, 2021
4cdb041
delete unnecessary files
Scrappers-glitch Apr 9, 2021
85ff1c8
delete unnecessary files
Scrappers-glitch Apr 9, 2021
5da6f17
delete unnecessary files
Scrappers-glitch Apr 9, 2021
c2030d6
Merge branch 'master' into master
Scrappers-glitch Apr 9, 2021
b534a04
remove unused files
Scrappers-glitch Apr 9, 2021
4cbcc63
remove conflicting files
Scrappers-glitch Apr 9, 2021
bcdb538
remove conflicting files
Scrappers-glitch Apr 9, 2021
136a592
remove conflicting files
Scrappers-glitch Apr 9, 2021
b9982bc
Reviving missing build files(settings.gradle, gradlew.bat, gradle.pro…
Scrappers-glitch Apr 9, 2021
8f21553
delete unnecessary files
Scrappers-glitch Apr 9, 2021
7005a96
Added JmeSurfaceView.java class , for embedding jme-game in a custom …
Scrappers-glitch Mar 27, 2021
ec5126e
Cleaning up (formatting errors/jme copyright)
Scrappers-glitch Apr 2, 2021
bb32b91
Moved the class files into an independent package
Scrappers-glitch Apr 2, 2021
ce29317
Reviving missing build files(settings.gradle, gradlew.bat, gradle.pro…
Scrappers-glitch Apr 9, 2021
b578cb5
delete unnecessary files
Scrappers-glitch Apr 9, 2021
726555c
delete unnecessary files
Scrappers-glitch Apr 9, 2021
60869e4
delete unnecessary files
Scrappers-glitch Apr 9, 2021
25179e0
delete unnecessary files
Scrappers-glitch Apr 9, 2021
a0c8474
delete unnecessary files
Scrappers-glitch Apr 9, 2021
6655788
delete unnecessary files
Scrappers-glitch Apr 9, 2021
00dbf8e
delete unnecessary files
Scrappers-glitch Apr 9, 2021
6da6cf8
delete unnecessary files
Scrappers-glitch Apr 9, 2021
8c9fdc9
delete unnecessary files
Scrappers-glitch Apr 9, 2021
70e3b0c
Merge remote-tracking branch 'origin/master'
Scrappers-glitch Apr 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
#Fri Apr 09 04:09:56 CDT 2021
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to "gradle-wrapper.properties" appear to be unnecessary. Please revert them.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
1 change: 0 additions & 1 deletion jme3-android-examples/.gitignore

This file was deleted.

63 changes: 0 additions & 63 deletions jme3-android-examples/build.gradle

This file was deleted.

15 changes: 15 additions & 0 deletions jme3-android-examples/jme3-android-tests/.gitignore
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
1 change: 1 addition & 0 deletions jme3-android-examples/jme3-android-tests/app/.gitignore
@@ -0,0 +1 @@
/build
53 changes: 53 additions & 0 deletions jme3-android-examples/jme3-android-tests/app/build.gradle
@@ -0,0 +1,53 @@
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "org.jmonkeyengine.jme3androidexamples"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
configurations.all {
exclude group:"org.jmonkeyengine",module:"jme3-desktop"
exclude group: 'jbullet', module:'jbullet'
exclude group: 'stack-alloc', module:'stack-alloc'
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
/*add the JMonkeyEngine Dependencies*/
runtimeOnly project(":stack-alloc")
implementation project(":jbullet")
implementation "org.jmonkeyengine:jme3-core:3.4.0-alpha7"
Copy link
Member

@Ali-RS Ali-RS Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is changed from compile project(':jme3-core') to implementation "org.jmonkeyengine:jme3-core:3.4.0-alpha7"?

the same goes for other dependencies as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's because i have separated this android-example in a separate module(package) from jmonkeyengine, that has it's own gradle builds & source, that was the only way to make it runnable, because Android gradle is different from java gradle, btw this example wasn't runnable & there were build files that are missing, listed in the title of the PR.

If you have a good idea of including the folders that aren't in project root module(ie from local disk) in gradle, we could try it instead of remote implementation.

implementation "org.jmonkeyengine:jme3-examples:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-jbullet:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-effects:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-android-native:3.4.0-alpha7"
implementation "org.jmonkeyengine:jme3-lwjgl:3.4.0-alpha7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why jme3-lwjgl is in dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ali-RS thanks for reviewing,
yeh, the author who made this android example, uses all jmonkeyengine examples through direct gradle dependiceis (of test-data & examples) & classNames, i haven't dig deeper inside jme3-examples, so i thought may be at least one example would use something lwjgl related, but you are right lwjgl is useless for android.

}
21 changes: 21 additions & 0 deletions jme3-android-examples/jme3-android-tests/app/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,26 @@
package com.scrappers.myapplication;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the package name is changed to com.scrappers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, i did make sure that all package names are assigned to jme3 but seems i have forgot to refractor the testClasses


import android.content.Context;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.scrappers.myapplication", appContext.getPackageName());
}
}
Expand Up @@ -21,7 +21,7 @@
<activity
android:name=".TestActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/Theme.Design.NoActionBar"
android:screenOrientation="landscape">
</activity>
</application>
Expand Down
Expand Up @@ -3,7 +3,6 @@
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
Expand All @@ -17,6 +16,7 @@
import android.widget.EditText;
import android.widget.ListView;
import com.jme3.app.Application;
import androidx.appcompat.app.AppCompatActivity;
import dalvik.system.DexFile;
import java.io.IOException;
import java.util.ArrayList;
Expand Down
Expand Up @@ -2,11 +2,11 @@

import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.jme3.system.JmeSystem;
import androidx.appcompat.app.AppCompatActivity;

public class TestActivity extends AppCompatActivity {
JmeFragment fragment;
Expand Down
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>