Commit 79f775ca authored by Drahomír Karchňák's avatar Drahomír Karchňák

#421 Clean up...

parent 81bfde82
......@@ -30,7 +30,6 @@ android {
buildConfigField ASSETS_CHECKSUM_FIELD_TYPE, ASSETS_CHECKSUM_FIELD_NAME, rootProject.ext.assetsChecksumPattern
resValue "string", "app_name", "${tablexiaAppName}"
resValue "string", "sentry_dsn", project.hasProperty('TABLEXIA_SENTRY_DSN_DEBUG') ? "$TABLEXIA_SENTRY_DSN_DEBUG" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn_fallback_value", "$project.sentryDSNFallbackValue";
}
release {
debuggable false
......@@ -38,7 +37,6 @@ android {
buildConfigField ASSETS_CHECKSUM_FIELD_TYPE, ASSETS_CHECKSUM_FIELD_NAME, rootProject.ext.assetsChecksumPattern
resValue "string", "app_name", "${tablexiaAppName}"
resValue "string", "sentry_dsn", project.hasProperty('TABLEXIA_SENTRY_DSN_RELEASE') ? "$TABLEXIA_SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn_fallback_value", "$project.sentryDSNFallbackValue";
}
devel.initWith(buildTypes.debug)
devel {
......@@ -46,7 +44,6 @@ android {
buildConfigField ASSETS_CHECKSUM_FIELD_TYPE, ASSETS_CHECKSUM_FIELD_NAME, rootProject.ext.assetsChecksumPattern
resValue "string", "app_name", "${tablexiaAppName}"
resValue "string", "sentry_dsn", "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn_fallback_value", "$project.sentryDSNFallbackValue";
}
}
......
......@@ -38,15 +38,11 @@ public class AndroidLauncher extends AndroidApplication {
config.useWakelock = true;
config.numSamples = MULTI_SAMPLING_2X;
String sentryDSNFallback = getResources().getString(R.string.sentry_dsn_fallback_value);
String sentryDSN = getResources().getString(R.string.sentry_dsn);
String DSN = (sentryDSNFallback == null || sentryDSN == null || sentryDSN.equals(sentryDSNFallback)) ? null : sentryDSN;
initialize(tablexia = new Tablexia(BuildConfig.BUILD_TYPE,
getResources().getConfiguration().locale,
SQL_CONNECTION_TYPE,
new AndroidConnectionManager(getContext()),
DSN, //Pass null if sentryDSN doesnt exist
getResources().getString(R.string.sentry_dsn),
HAS_SOFT_BACK_BUTTON,
savedInstanceState == null), config);
......
......@@ -43,6 +43,7 @@ task writeTablexiaBuildConfig {
" public final static Integer TABLEXIA_SERVER_PORT = ${project.hasProperty('TABLEXIA_SERVER_PORT') ? "$TABLEXIA_SERVER_PORT" : "null"};\n" +
" public final static String TABLEXIA_SERVER_SECRET = ${project.hasProperty('TABLEXIA_SERVER_SECRET') ? "\"$TABLEXIA_SERVER_SECRET\"" : "null"};\n" +
" public final static String FLURRY_KEY = ${project.hasProperty('TABLEXIA_FLURRY_KEY') ? "\"$TABLEXIA_FLURRY_KEY\"" : "null"};\n" +
" public final static String SENTRY_DSN_FALLBACK = \"${project.sentryDSNFallbackValue}\";\n" +
"\n" +
"}", BUILD_CONFIG_FILE_ENCODING)
}
......
......@@ -68,7 +68,6 @@ public class Tablexia extends TablexiaApplication {
private static IConnectionManager connectionManager;
private final SQLConnectionType sqlConnectionType;
// private final Raven raven;
private MenuController menuController;
private TablexiaButton backButton;
private boolean backButtonVisibility;
......@@ -113,8 +112,10 @@ public class Tablexia extends TablexiaApplication {
}
});
if(TablexiaSettings.getInstance().getBuildType().isBugReport())
TablexiaRaven.start(sentryDSN);
if(TablexiaSettings.getInstance().getBuildType().isBugReport()) {
String DSN = (TablexiaBuildConfig.SENTRY_DSN_FALLBACK == null || sentryDSN == null || sentryDSN.equals(TablexiaBuildConfig.SENTRY_DSN_FALLBACK)) ? null : sentryDSN;
TablexiaRaven.start(DSN);
}
}
private void loadingComplete() {
......
......@@ -49,7 +49,6 @@ task releaseJar(type: Jar) {
attributes 'Assets-Cheksums': getMapConvertedToString(rootProject.ext.assetsChecksum)
attributes 'Sentry-DSN': project.hasProperty('TABLEXIA_SENTRY_DSN_RELEASE') ? "$TABLEXIA_SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
attributes 'Sentry-DSN-Fallback': "$project.sentryDSNFallbackValue";
}
}
}
......
......@@ -16,7 +16,6 @@ public class DesktopLauncher {
private static final String BUILD_VARIANT_MANIFEST_ATTRIBUTE = "Build-Type";
private static final String SENTRY_DSN_KEY_MANIFEST_ATTRIBUTE = "Sentry-DSN";
private static final String SENTRY_DSN_FALLBACK_MANIFEST_ATTRIBUTE = "Sentry-DSN-Fallback";
private static final boolean HAS_SOFT_BACK_BUTTON = true;
private static final String DESKTOP_ICON_PATH = "icon/";
......@@ -34,13 +33,8 @@ public class DesktopLauncher {
public static final Tablexia.SQLConnectionType SQL_CONNECTION_TYPE = new Tablexia.SQLConnectionType("org.sqlite.JDBC", "jdbc:sqlite:");
public static void main(String[] arg) {
String buildType = loadAttributeFromManifest(BUILD_VARIANT_MANIFEST_ATTRIBUTE, TablexiaSettings.BuildType.DEVEL.getKey());
String sentryDSN = loadAttributeFromManifest(SENTRY_DSN_KEY_MANIFEST_ATTRIBUTE, null);
String sentryDSNFallback = loadAttributeFromManifest(SENTRY_DSN_FALLBACK_MANIFEST_ATTRIBUTE, null);
String DSN = (sentryDSNFallback == null || sentryDSN == null || sentryDSN.equals(sentryDSNFallback)) ? null : sentryDSN;
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.resizable = buildType == null || buildType.equals(TablexiaSettings.BuildType.DEVEL.getKey());
......@@ -63,7 +57,7 @@ public class DesktopLauncher {
config.addIcon(DESKTOP_ICON_128, Files.FileType.Internal);
}
new LwjglApplication(new Tablexia(buildType, Locale.getDefault(), SQL_CONNECTION_TYPE, new DesktopConnectionManager(), DSN, HAS_SOFT_BACK_BUTTON, true), config);
new LwjglApplication(new Tablexia(buildType, Locale.getDefault(), SQL_CONNECTION_TYPE, new DesktopConnectionManager(), sentryDSN, HAS_SOFT_BACK_BUTTON, true), config);
}
private static String loadAttributeFromManifest(String attributeName, String defaultValue) {
......
......@@ -26,8 +26,6 @@
<string>${app.buildtype}</string>
<key>cz.nic.tablexia.SentryDSN</key>
<string>${app.sentryDSN}</string>
<key>cz.nic.tablexia.SentryDSNFallback</key>
<string>${app.sentryDSNFallback}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
......
......@@ -30,7 +30,6 @@ def updateRoboVMProperties(String buildType, String applicationId, String iconNa
props.setProperty('app.buildtype', buildType)
props.setProperty('app.build', '' + tablexiaVersionCode)
props.setProperty('app.executable', tablexiaAppName + '-' + buildType + '-' + tablexiaVersionName)
props.setProperty('app.sentryDSNFallback', sentryDSNFallbackValue)
props.setProperty('app.sentryDSN', DSN)
props.store(propsFile.newDataOutputStream(), '')
......@@ -52,12 +51,6 @@ task copyNatives << {
}
}
}
//copy {
// from 'libs/'
// into 'build/libs/ios'
// include '*.a'
//}
}
// Updates a robovm.xml file.
......
......@@ -43,17 +43,14 @@ public class IOSLauncher extends IOSApplication.Delegate {
NSDictionary infoDictionary = NSBundle.getMainBundle().getInfoDictionary();
String buildType = infoDictionary.get(new NSString(TABLEXIA_BUILD_TYPE_KEY)).toString();
String sentryDSNFallback = infoDictionary.get(new NSString(TABLEXIA_SENTRY_DSN_FALLBACK_KEY)).toString();
String sentryDSN = infoDictionary.get(new NSString(TABLEXIA_SENTRY_DSN_KEY)).toString();
String DSN = (sentryDSNFallback == null || sentryDSN == null || sentryDSN.equals(sentryDSNFallback)) ? null : sentryDSN;
String sentryDSN = infoDictionary.get(new NSString(TABLEXIA_SENTRY_DSN_KEY)).toString();
tablexiaIOSFiles = new TablexiaIOSFiles();
IOSApplication iosApplication = new IOSApplication(new Tablexia(buildType,
Locale.getDefault(),
SQL_CONNECTION_TYPE,
new IOSConnectionManager(),
DSN,
sentryDSN,
HAS_SOFT_BACK_BUTTON,
false), config) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment