Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1032814 // uploadTranspilation

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11026L/62K).

1  
// returns (transpilationResult, compilationResult)
2  
3  
static PairS uploadTranspilation(S progID, S transpilation, LS libs) {
4  
  S server = tb_mainServer();
5  
  
6  
  S transpilationResult = postPageWithCredentials(server + "/tb/upload-transpilation.php",
7  
    id := psI(progID),
8  
    +transpilation,
9  
    libs := lines(map parseSnippetID(libs)),
10  
    computer := computerID());
11  
    
12  
  Matcher m = regexp("URL=/(dexcompile\\.php.*?)'", transpilationResult);
13  
  if (!m.find()) fail("Server said: " + transpilationResult);
14  
  
15  
  S url = addParamToURL(server + "/" + m.group(1), useJarBot := 1);
16  
17  
  S compilationResult = postPageWithCredentials(url);
18  
  print(compilationResult);
19  
  
20  
  bool ok = compilationResult.contains("<title>" + "SUCCESS"); // XXX
21  
  sendToSnippetUpdatesBot((ok ? "/transpileOK" : "transpileFail") 
22  
    + "/" + psI(progID));
23  
    
24  
      
25  
  if (!ok)
26  
    fail("Server said: " + compilationResult);
27  
    
28  
  print("Transpiled & uploaded " + fsI(progID) + "!");
29  
  ret pair(transpilationResult, compilationResult);
30  
}

Author comment

Began life as a copy of #1011923

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032814
Snippet name: uploadTranspilation
Eternal ID of this version: #1032814/11
Text MD5: 134059fcae482cd0a0d2ac1ee9841dd0
Transpilation MD5: 709bc8463e28800660a058614232504a
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-11 00:38:58
Source code size: 1040 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 186 / 282
Version history: 10 change(s)
Referenced in: [show references]